var gp = {};
function ar(e, t) {
  const n = /* @__PURE__ */ Object.create(null), r = e.split(",");
  for (let o = 0; o < r.length; o++)
    n[r[o]] = !0;
  return t ? (o) => !!n[o.toLowerCase()] : (o) => !!n[o];
}
const Ve = gp.NODE_ENV !== "production" ? Object.freeze({}) : {}, bo = gp.NODE_ENV !== "production" ? Object.freeze([]) : [], vt = () => {
}, vp = () => !1, ss = (e) => e.charCodeAt(0) === 111 && e.charCodeAt(1) === 110 && // uppercase letter
(e.charCodeAt(2) > 122 || e.charCodeAt(2) < 97), va = (e) => e.startsWith("onUpdate:"), Ze = Object.assign, gu = (e, t) => {
  const n = e.indexOf(t);
  n > -1 && e.splice(n, 1);
}, _y = Object.prototype.hasOwnProperty, Ne = (e, t) => _y.call(e, t), ge = Array.isArray, Co = (e) => Za(e) === "[object Map]", Iy = (e) => Za(e) === "[object Set]", be = (e) => typeof e == "function", tt = (e) => typeof e == "string", qa = (e) => typeof e == "symbol", ze = (e) => e !== null && typeof e == "object", vu = (e) => (ze(e) || be(e)) && be(e.then) && be(e.catch), Ny = Object.prototype.toString, Za = (e) => Ny.call(e), yu = (e) => Za(e).slice(8, -1), Ty = (e) => Za(e) === "[object Object]", bu = (e) => tt(e) && e !== "NaN" && e[0] !== "-" && "" + parseInt(e, 10) === e, ea = /* @__PURE__ */ ar(
  // the leading comma is intentional so empty string "" is also included
  ",key,ref,ref_for,ref_key,onVnodeBeforeMount,onVnodeMounted,onVnodeBeforeUpdate,onVnodeUpdated,onVnodeBeforeUnmount,onVnodeUnmounted"
), Oy = /* @__PURE__ */ ar(
  "bind,cloak,else-if,else,for,html,if,model,on,once,pre,show,slot,text,memo"
), Xa = (e) => {
  const t = /* @__PURE__ */ Object.create(null);
  return (n) => t[n] || (t[n] = e(n));
}, Ay = /-(\w)/g, Oo = Xa((e) => e.replace(Ay, (t, n) => n ? n.toUpperCase() : "")), Dy = /\B([A-Z])/g, Qn = Xa(
  (e) => e.replace(Dy, "-$1").toLowerCase()
), Ja = Xa((e) => e.charAt(0).toUpperCase() + e.slice(1)), mr = Xa((e) => e ? `on${Ja(e)}` : ""), Fr = (e, t) => !Object.is(e, t), Xo = (e, t) => {
  for (let n = 0; n < e.length; n++)
    e[n](t);
}, ya = (e, t, n) => {
  Object.defineProperty(e, t, {
    configurable: !0,
    enumerable: !1,
    value: n
  });
}, My = (e) => {
  const t = parseFloat(e);
  return isNaN(t) ? e : t;
}, $y = (e) => {
  const t = tt(e) ? Number(e) : NaN;
  return isNaN(t) ? e : t;
};
let yd;
const ba = () => yd || (yd = typeof globalThis < "u" ? globalThis : typeof self < "u" ? self : typeof window < "u" ? window : typeof global < "u" ? global : {});
function Cu(e) {
  if (ge(e)) {
    const t = {};
    for (let n = 0; n < e.length; n++) {
      const r = e[n], o = tt(r) ? Fy(r) : Cu(r);
      if (o)
        for (const i in o)
          t[i] = o[i];
    }
    return t;
  } else if (tt(e) || ze(e))
    return e;
}
const ky = /;(?![^(]*\))/g, Ry = /:([^]+)/, Py = /\/\*[^]*?\*\//g;
function Fy(e) {
  const t = {};
  return e.replace(Py, "").split(ky).forEach((n) => {
    if (n) {
      const r = n.split(Ry);
      r.length > 1 && (t[r[0].trim()] = r[1].trim());
    }
  }), t;
}
function wu(e) {
  let t = "";
  if (tt(e))
    t = e;
  else if (ge(e))
    for (let n = 0; n < e.length; n++) {
      const r = wu(e[n]);
      r && (t += r + " ");
    }
  else if (ze(e))
    for (const n in e)
      e[n] && (t += n + " ");
  return t.trim();
}
const By = "html,body,base,head,link,meta,style,title,address,article,aside,footer,header,hgroup,h1,h2,h3,h4,h5,h6,nav,section,div,dd,dl,dt,figcaption,figure,picture,hr,img,li,main,ol,p,pre,ul,a,b,abbr,bdi,bdo,br,cite,code,data,dfn,em,i,kbd,mark,q,rp,rt,ruby,s,samp,small,span,strong,sub,sup,time,u,var,wbr,area,audio,map,track,video,embed,object,param,source,canvas,script,noscript,del,ins,caption,col,colgroup,table,thead,tbody,td,th,tr,button,datalist,fieldset,form,input,label,legend,meter,optgroup,option,output,progress,select,textarea,details,dialog,menu,summary,template,blockquote,iframe,tfoot", Ly = "svg,animate,animateMotion,animateTransform,circle,clipPath,color-profile,defs,desc,discard,ellipse,feBlend,feColorMatrix,feComponentTransfer,feComposite,feConvolveMatrix,feDiffuseLighting,feDisplacementMap,feDistantLight,feDropShadow,feFlood,feFuncA,feFuncB,feFuncG,feFuncR,feGaussianBlur,feImage,feMerge,feMergeNode,feMorphology,feOffset,fePointLight,feSpecularLighting,feSpotLight,feTile,feTurbulence,filter,foreignObject,g,hatch,hatchpath,image,line,linearGradient,marker,mask,mesh,meshgradient,meshpatch,meshrow,metadata,mpath,path,pattern,polygon,polyline,radialGradient,rect,set,solidcolor,stop,switch,symbol,text,textPath,title,tspan,unknown,use,view", Vy = /* @__PURE__ */ ar(By), zy = /* @__PURE__ */ ar(Ly), jy = "itemscope,allowfullscreen,formnovalidate,ismap,nomodule,novalidate,readonly", Hy = /* @__PURE__ */ ar(jy);
function yp(e) {
  return !!e || e === "";
}
var it = {};
function nc(e, ...t) {
  console.warn(`[Vue warn] ${e}`, ...t);
}
let qt;
class Wy {
  constructor(t = !1) {
    this.detached = t, this._active = !0, this.effects = [], this.cleanups = [], this.parent = qt, !t && qt && (this.index = (qt.scopes || (qt.scopes = [])).push(
      this
    ) - 1);
  }
  get active() {
    return this._active;
  }
  run(t) {
    if (this._active) {
      const n = qt;
      try {
        return qt = this, t();
      } finally {
        qt = n;
      }
    } else
      it.NODE_ENV !== "production" && nc("cannot run an inactive effect scope.");
  }
  /**
   * This should only be called on non-detached scopes
   * @internal
   */
  on() {
    qt = this;
  }
  /**
   * This should only be called on non-detached scopes
   * @internal
   */
  off() {
    qt = this.parent;
  }
  stop(t) {
    if (this._active) {
      let n, r;
      for (n = 0, r = this.effects.length; n < r; n++)
        this.effects[n].stop();
      for (n = 0, r = this.cleanups.length; n < r; n++)
        this.cleanups[n]();
      if (this.scopes)
        for (n = 0, r = this.scopes.length; n < r; n++)
          this.scopes[n].stop(!0);
      if (!this.detached && this.parent && !t) {
        const o = this.parent.scopes.pop();
        o && o !== this && (this.parent.scopes[this.index] = o, o.index = this.index);
      }
      this.parent = void 0, this._active = !1;
    }
  }
}
function Uy(e, t = qt) {
  t && t.active && t.effects.push(e);
}
function Ky() {
  return qt;
}
const Pi = (e) => {
  const t = new Set(e);
  return t.w = 0, t.n = 0, t;
}, bp = (e) => (e.w & er) > 0, Cp = (e) => (e.n & er) > 0, Gy = ({ deps: e }) => {
  if (e.length)
    for (let t = 0; t < e.length; t++)
      e[t].w |= er;
}, Yy = (e) => {
  const { deps: t } = e;
  if (t.length) {
    let n = 0;
    for (let r = 0; r < t.length; r++) {
      const o = t[r];
      bp(o) && !Cp(o) ? o.delete(e) : t[n++] = o, o.w &= ~er, o.n &= ~er;
    }
    t.length = n;
  }
}, Ca = /* @__PURE__ */ new WeakMap();
let si = 0, er = 1;
const rc = 30;
let Tt;
const Nr = Symbol(it.NODE_ENV !== "production" ? "iterate" : ""), oc = Symbol(it.NODE_ENV !== "production" ? "Map key iterate" : "");
class xu {
  constructor(t, n = null, r) {
    this.fn = t, this.scheduler = n, this.active = !0, this.deps = [], this.parent = void 0, Uy(this, r);
  }
  run() {
    if (!this.active)
      return this.fn();
    let t = Tt, n = qn;
    for (; t; ) {
      if (t === this)
        return;
      t = t.parent;
    }
    try {
      return this.parent = Tt, Tt = this, qn = !0, er = 1 << ++si, si <= rc ? Gy(this) : bd(this), this.fn();
    } finally {
      si <= rc && Yy(this), er = 1 << --si, Tt = this.parent, qn = n, this.parent = void 0, this.deferStop && this.stop();
    }
  }
  stop() {
    Tt === this ? this.deferStop = !0 : this.active && (bd(this), this.onStop && this.onStop(), this.active = !1);
  }
}
function bd(e) {
  const { deps: t } = e;
  if (t.length) {
    for (let n = 0; n < t.length; n++)
      t[n].delete(e);
    t.length = 0;
  }
}
let qn = !0;
const wp = [];
function Kr() {
  wp.push(qn), qn = !1;
}
function Gr() {
  const e = wp.pop();
  qn = e === void 0 ? !0 : e;
}
function yt(e, t, n) {
  if (qn && Tt) {
    let r = Ca.get(e);
    r || Ca.set(e, r = /* @__PURE__ */ new Map());
    let o = r.get(n);
    o || r.set(n, o = Pi());
    const i = it.NODE_ENV !== "production" ? { effect: Tt, target: e, type: t, key: n } : void 0;
    ic(o, i);
  }
}
function ic(e, t) {
  let n = !1;
  si <= rc ? Cp(e) || (e.n |= er, n = !bp(e)) : n = !e.has(Tt), n && (e.add(Tt), Tt.deps.push(e), it.NODE_ENV !== "production" && Tt.onTrack && Tt.onTrack(
    Ze(
      {
        effect: Tt
      },
      t
    )
  ));
}
function dn(e, t, n, r, o, i) {
  const s = Ca.get(e);
  if (!s)
    return;
  let a = [];
  if (t === "clear")
    a = [...s.values()];
  else if (n === "length" && ge(e)) {
    const c = Number(r);
    s.forEach((u, d) => {
      (d === "length" || !qa(d) && d >= c) && a.push(u);
    });
  } else
    switch (n !== void 0 && a.push(s.get(n)), t) {
      case "add":
        ge(e) ? bu(n) && a.push(s.get("length")) : (a.push(s.get(Nr)), Co(e) && a.push(s.get(oc)));
        break;
      case "delete":
        ge(e) || (a.push(s.get(Nr)), Co(e) && a.push(s.get(oc)));
        break;
      case "set":
        Co(e) && a.push(s.get(Nr));
        break;
    }
  const l = it.NODE_ENV !== "production" ? { target: e, type: t, key: n, newValue: r, oldValue: o, oldTarget: i } : void 0;
  if (a.length === 1)
    a[0] && (it.NODE_ENV !== "production" ? po(a[0], l) : po(a[0]));
  else {
    const c = [];
    for (const u of a)
      u && c.push(...u);
    it.NODE_ENV !== "production" ? po(Pi(c), l) : po(Pi(c));
  }
}
function po(e, t) {
  const n = ge(e) ? e : [...e];
  for (const r of n)
    r.computed && Cd(r, t);
  for (const r of n)
    r.computed || Cd(r, t);
}
function Cd(e, t) {
  (e !== Tt || e.allowRecurse) && (it.NODE_ENV !== "production" && e.onTrigger && e.onTrigger(Ze({ effect: e }, t)), e.scheduler ? e.scheduler() : e.run());
}
function qy(e, t) {
  var n;
  return (n = Ca.get(e)) == null ? void 0 : n.get(t);
}
const Zy = /* @__PURE__ */ ar("__proto__,__v_isRef,__isVue"), xp = new Set(
  /* @__PURE__ */ Object.getOwnPropertyNames(Symbol).filter((e) => e !== "arguments" && e !== "caller").map((e) => Symbol[e]).filter(qa)
), wd = /* @__PURE__ */ Xy();
function Xy() {
  const e = {};
  return ["includes", "indexOf", "lastIndexOf"].forEach((t) => {
    e[t] = function(...n) {
      const r = Se(this);
      for (let i = 0, s = this.length; i < s; i++)
        yt(r, "get", i + "");
      const o = r[t](...n);
      return o === -1 || o === !1 ? r[t](...n.map(Se)) : o;
    };
  }), ["push", "pop", "shift", "unshift", "splice"].forEach((t) => {
    e[t] = function(...n) {
      Kr();
      const r = Se(this)[t].apply(this, n);
      return Gr(), r;
    };
  }), e;
}
function Jy(e) {
  const t = Se(this);
  return yt(t, "has", e), t.hasOwnProperty(e);
}
class Sp {
  constructor(t = !1, n = !1) {
    this._isReadonly = t, this._shallow = n;
  }
  get(t, n, r) {
    const o = this._isReadonly, i = this._shallow;
    if (n === "__v_isReactive")
      return !o;
    if (n === "__v_isReadonly")
      return o;
    if (n === "__v_isShallow")
      return i;
    if (n === "__v_raw")
      return r === (o ? i ? Ap : Op : i ? Tp : Np).get(t) || // receiver is not the reactive proxy, but has the same prototype
      // this means the reciever is a user proxy of the reactive proxy
      Object.getPrototypeOf(t) === Object.getPrototypeOf(r) ? t : void 0;
    const s = ge(t);
    if (!o) {
      if (s && Ne(wd, n))
        return Reflect.get(wd, n, r);
      if (n === "hasOwnProperty")
        return Jy;
    }
    const a = Reflect.get(t, n, r);
    return (qa(n) ? xp.has(n) : Zy(n)) || (o || yt(t, "get", n), i) ? a : et(a) ? s && bu(n) ? a : a.value : ze(a) ? o ? On(a) : Eu(a) : a;
  }
}
class Ep extends Sp {
  constructor(t = !1) {
    super(!1, t);
  }
  set(t, n, r, o) {
    let i = t[n];
    if (tr(i) && et(i) && !et(r))
      return !1;
    if (!this._shallow && (!wa(r) && !tr(r) && (i = Se(i), r = Se(r)), !ge(t) && et(i) && !et(r)))
      return i.value = r, !0;
    const s = ge(t) && bu(n) ? Number(n) < t.length : Ne(t, n), a = Reflect.set(t, n, r, o);
    return t === Se(o) && (s ? Fr(r, i) && dn(t, "set", n, r, i) : dn(t, "add", n, r)), a;
  }
  deleteProperty(t, n) {
    const r = Ne(t, n), o = t[n], i = Reflect.deleteProperty(t, n);
    return i && r && dn(t, "delete", n, void 0, o), i;
  }
  has(t, n) {
    const r = Reflect.has(t, n);
    return (!qa(n) || !xp.has(n)) && yt(t, "has", n), r;
  }
  ownKeys(t) {
    return yt(
      t,
      "iterate",
      ge(t) ? "length" : Nr
    ), Reflect.ownKeys(t);
  }
}
class _p extends Sp {
  constructor(t = !1) {
    super(!0, t);
  }
  set(t, n) {
    return it.NODE_ENV !== "production" && nc(
      `Set operation on key "${String(n)}" failed: target is readonly.`,
      t
    ), !0;
  }
  deleteProperty(t, n) {
    return it.NODE_ENV !== "production" && nc(
      `Delete operation on key "${String(n)}" failed: target is readonly.`,
      t
    ), !0;
  }
}
const Qy = /* @__PURE__ */ new Ep(), eb = /* @__PURE__ */ new _p(), tb = /* @__PURE__ */ new Ep(
  !0
), nb = /* @__PURE__ */ new _p(!0), Su = (e) => e, Qa = (e) => Reflect.getPrototypeOf(e);
function Es(e, t, n = !1, r = !1) {
  e = e.__v_raw;
  const o = Se(e), i = Se(t);
  n || (Fr(t, i) && yt(o, "get", t), yt(o, "get", i));
  const { has: s } = Qa(o), a = r ? Su : n ? _u : Fi;
  if (s.call(o, t))
    return a(e.get(t));
  if (s.call(o, i))
    return a(e.get(i));
  e !== o && e.get(t);
}
function _s(e, t = !1) {
  const n = this.__v_raw, r = Se(n), o = Se(e);
  return t || (Fr(e, o) && yt(r, "has", e), yt(r, "has", o)), e === o ? n.has(e) : n.has(e) || n.has(o);
}
function Is(e, t = !1) {
  return e = e.__v_raw, !t && yt(Se(e), "iterate", Nr), Reflect.get(e, "size", e);
}
function xd(e) {
  e = Se(e);
  const t = Se(this);
  return Qa(t).has.call(t, e) || (t.add(e), dn(t, "add", e, e)), this;
}
function Sd(e, t) {
  t = Se(t);
  const n = Se(this), { has: r, get: o } = Qa(n);
  let i = r.call(n, e);
  i ? it.NODE_ENV !== "production" && Ip(n, r, e) : (e = Se(e), i = r.call(n, e));
  const s = o.call(n, e);
  return n.set(e, t), i ? Fr(t, s) && dn(n, "set", e, t, s) : dn(n, "add", e, t), this;
}
function Ed(e) {
  const t = Se(this), { has: n, get: r } = Qa(t);
  let o = n.call(t, e);
  o ? it.NODE_ENV !== "production" && Ip(t, n, e) : (e = Se(e), o = n.call(t, e));
  const i = r ? r.call(t, e) : void 0, s = t.delete(e);
  return o && dn(t, "delete", e, void 0, i), s;
}
function _d() {
  const e = Se(this), t = e.size !== 0, n = it.NODE_ENV !== "production" ? Co(e) ? new Map(e) : new Set(e) : void 0, r = e.clear();
  return t && dn(e, "clear", void 0, void 0, n), r;
}
function Ns(e, t) {
  return function(r, o) {
    const i = this, s = i.__v_raw, a = Se(s), l = t ? Su : e ? _u : Fi;
    return !e && yt(a, "iterate", Nr), s.forEach((c, u) => r.call(o, l(c), l(u), i));
  };
}
function Ts(e, t, n) {
  return function(...r) {
    const o = this.__v_raw, i = Se(o), s = Co(i), a = e === "entries" || e === Symbol.iterator && s, l = e === "keys" && s, c = o[e](...r), u = n ? Su : t ? _u : Fi;
    return !t && yt(
      i,
      "iterate",
      l ? oc : Nr
    ), {
      // iterator protocol
      next() {
        const { value: d, done: f } = c.next();
        return f ? { value: d, done: f } : {
          value: a ? [u(d[0]), u(d[1])] : u(d),
          done: f
        };
      },
      // iterable protocol
      [Symbol.iterator]() {
        return this;
      }
    };
  };
}
function Rn(e) {
  return function(...t) {
    if (it.NODE_ENV !== "production") {
      const n = t[0] ? `on key "${t[0]}" ` : "";
      console.warn(
        `${Ja(e)} operation ${n}failed: target is readonly.`,
        Se(this)
      );
    }
    return e === "delete" ? !1 : e === "clear" ? void 0 : this;
  };
}
function rb() {
  const e = {
    get(i) {
      return Es(this, i);
    },
    get size() {
      return Is(this);
    },
    has: _s,
    add: xd,
    set: Sd,
    delete: Ed,
    clear: _d,
    forEach: Ns(!1, !1)
  }, t = {
    get(i) {
      return Es(this, i, !1, !0);
    },
    get size() {
      return Is(this);
    },
    has: _s,
    add: xd,
    set: Sd,
    delete: Ed,
    clear: _d,
    forEach: Ns(!1, !0)
  }, n = {
    get(i) {
      return Es(this, i, !0);
    },
    get size() {
      return Is(this, !0);
    },
    has(i) {
      return _s.call(this, i, !0);
    },
    add: Rn("add"),
    set: Rn("set"),
    delete: Rn("delete"),
    clear: Rn("clear"),
    forEach: Ns(!0, !1)
  }, r = {
    get(i) {
      return Es(this, i, !0, !0);
    },
    get size() {
      return Is(this, !0);
    },
    has(i) {
      return _s.call(this, i, !0);
    },
    add: Rn("add"),
    set: Rn("set"),
    delete: Rn("delete"),
    clear: Rn("clear"),
    forEach: Ns(!0, !0)
  };
  return ["keys", "values", "entries", Symbol.iterator].forEach((i) => {
    e[i] = Ts(
      i,
      !1,
      !1
    ), n[i] = Ts(
      i,
      !0,
      !1
    ), t[i] = Ts(
      i,
      !1,
      !0
    ), r[i] = Ts(
      i,
      !0,
      !0
    );
  }), [
    e,
    n,
    t,
    r
  ];
}
const [
  ob,
  ib,
  sb,
  ab
] = /* @__PURE__ */ rb();
function el(e, t) {
  const n = t ? e ? ab : sb : e ? ib : ob;
  return (r, o, i) => o === "__v_isReactive" ? !e : o === "__v_isReadonly" ? e : o === "__v_raw" ? r : Reflect.get(
    Ne(n, o) && o in r ? n : r,
    o,
    i
  );
}
const lb = {
  get: /* @__PURE__ */ el(!1, !1)
}, cb = {
  get: /* @__PURE__ */ el(!1, !0)
}, ub = {
  get: /* @__PURE__ */ el(!0, !1)
}, db = {
  get: /* @__PURE__ */ el(!0, !0)
};
function Ip(e, t, n) {
  const r = Se(n);
  if (r !== n && t.call(e, r)) {
    const o = yu(e);
    console.warn(
      `Reactive ${o} contains both the raw and reactive versions of the same object${o === "Map" ? " as keys" : ""}, which can lead to inconsistencies. Avoid differentiating between the raw and reactive versions of an object and only use the reactive version if possible.`
    );
  }
}
const Np = /* @__PURE__ */ new WeakMap(), Tp = /* @__PURE__ */ new WeakMap(), Op = /* @__PURE__ */ new WeakMap(), Ap = /* @__PURE__ */ new WeakMap();
function fb(e) {
  switch (e) {
    case "Object":
    case "Array":
      return 1;
    case "Map":
    case "Set":
    case "WeakMap":
    case "WeakSet":
      return 2;
    default:
      return 0;
  }
}
function hb(e) {
  return e.__v_skip || !Object.isExtensible(e) ? 0 : fb(yu(e));
}
function Eu(e) {
  return tr(e) ? e : tl(
    e,
    !1,
    Qy,
    lb,
    Np
  );
}
function pb(e) {
  return tl(
    e,
    !1,
    tb,
    cb,
    Tp
  );
}
function On(e) {
  return tl(
    e,
    !0,
    eb,
    ub,
    Op
  );
}
function ai(e) {
  return tl(
    e,
    !0,
    nb,
    db,
    Ap
  );
}
function tl(e, t, n, r, o) {
  if (!ze(e))
    return it.NODE_ENV !== "production" && console.warn(`value cannot be made reactive: ${String(e)}`), e;
  if (e.__v_raw && !(t && e.__v_isReactive))
    return e;
  const i = o.get(e);
  if (i)
    return i;
  const s = hb(e);
  if (s === 0)
    return e;
  const a = new Proxy(
    e,
    s === 2 ? r : n
  );
  return o.set(e, a), a;
}
function Tr(e) {
  return tr(e) ? Tr(e.__v_raw) : !!(e && e.__v_isReactive);
}
function tr(e) {
  return !!(e && e.__v_isReadonly);
}
function wa(e) {
  return !!(e && e.__v_isShallow);
}
function sc(e) {
  return Tr(e) || tr(e);
}
function Se(e) {
  const t = e && e.__v_raw;
  return t ? Se(t) : e;
}
function Dp(e) {
  return ya(e, "__v_skip", !0), e;
}
const Fi = (e) => ze(e) ? Eu(e) : e, _u = (e) => ze(e) ? On(e) : e;
function Mp(e) {
  qn && Tt && (e = Se(e), it.NODE_ENV !== "production" ? ic(e.dep || (e.dep = Pi()), {
    target: e,
    type: "get",
    key: "value"
  }) : ic(e.dep || (e.dep = Pi())));
}
function $p(e, t) {
  e = Se(e);
  const n = e.dep;
  n && (it.NODE_ENV !== "production" ? po(n, {
    target: e,
    type: "set",
    key: "value",
    newValue: t
  }) : po(n));
}
function et(e) {
  return !!(e && e.__v_isRef === !0);
}
function Ee(e) {
  return kp(e, !1);
}
function mb(e) {
  return kp(e, !0);
}
function kp(e, t) {
  return et(e) ? e : new gb(e, t);
}
class gb {
  constructor(t, n) {
    this.__v_isShallow = n, this.dep = void 0, this.__v_isRef = !0, this._rawValue = n ? t : Se(t), this._value = n ? t : Fi(t);
  }
  get value() {
    return Mp(this), this._value;
  }
  set value(t) {
    const n = this.__v_isShallow || wa(t) || tr(t);
    t = n ? t : Se(t), Fr(t, this._rawValue) && (this._rawValue = t, this._value = n ? t : Fi(t), $p(this, t));
  }
}
function Rp(e) {
  return et(e) ? e.value : e;
}
const vb = {
  get: (e, t, n) => Rp(Reflect.get(e, t, n)),
  set: (e, t, n, r) => {
    const o = e[t];
    return et(o) && !et(n) ? (o.value = n, !0) : Reflect.set(e, t, n, r);
  }
};
function Pp(e) {
  return Tr(e) ? e : new Proxy(e, vb);
}
class yb {
  constructor(t, n, r) {
    this._object = t, this._key = n, this._defaultValue = r, this.__v_isRef = !0;
  }
  get value() {
    const t = this._object[this._key];
    return t === void 0 ? this._defaultValue : t;
  }
  set value(t) {
    this._object[this._key] = t;
  }
  get dep() {
    return qy(Se(this._object), this._key);
  }
}
class bb {
  constructor(t) {
    this._getter = t, this.__v_isRef = !0, this.__v_isReadonly = !0;
  }
  get value() {
    return this._getter();
  }
}
function nr(e, t, n) {
  return et(e) ? e : be(e) ? new bb(e) : ze(e) && arguments.length > 1 ? Cb(e, t, n) : Ee(e);
}
function Cb(e, t, n) {
  const r = e[t];
  return et(r) ? r : new yb(e, t, n);
}
class wb {
  constructor(t, n, r, o) {
    this._setter = n, this.dep = void 0, this.__v_isRef = !0, this.__v_isReadonly = !1, this._dirty = !0, this.effect = new xu(t, () => {
      this._dirty || (this._dirty = !0, $p(this));
    }), this.effect.computed = this, this.effect.active = this._cacheable = !o, this.__v_isReadonly = r;
  }
  get value() {
    const t = Se(this);
    return Mp(t), (t._dirty || !t._cacheable) && (t._dirty = !1, t._value = t.effect.run()), t._value;
  }
  set value(t) {
    this._setter(t);
  }
}
function xb(e, t, n = !1) {
  let r, o;
  const i = be(e);
  i ? (r = e, o = it.NODE_ENV !== "production" ? () => {
    console.warn("Write operation failed: computed value is readonly");
  } : vt) : (r = e.get, o = e.set);
  const s = new wb(r, o, i || !o, n);
  return it.NODE_ENV !== "production" && t && !n && (s.effect.onTrack = t.onTrack, s.effect.onTrigger = t.onTrigger), s;
}
var M = {};
const Or = [];
function ta(e) {
  Or.push(e);
}
function na() {
  Or.pop();
}
function Z(e, ...t) {
  if (M.NODE_ENV === "production")
    return;
  Kr();
  const n = Or.length ? Or[Or.length - 1].component : null, r = n && n.appContext.config.warnHandler, o = Sb();
  if (r)
    En(
      r,
      n,
      11,
      [
        e + t.join(""),
        n && n.proxy,
        o.map(
          ({ vnode: i }) => `at <${ul(n, i.type)}>`
        ).join(`
`),
        o
      ]
    );
  else {
    const i = [`[Vue warn]: ${e}`, ...t];
    o.length && i.push(`
`, ...Eb(o)), console.warn(...i);
  }
  Gr();
}
function Sb() {
  let e = Or[Or.length - 1];
  if (!e)
    return [];
  const t = [];
  for (; e; ) {
    const n = t[0];
    n && n.vnode === e ? n.recurseCount++ : t.push({
      vnode: e,
      recurseCount: 0
    });
    const r = e.component && e.component.parent;
    e = r && r.vnode;
  }
  return t;
}
function Eb(e) {
  const t = [];
  return e.forEach((n, r) => {
    t.push(...r === 0 ? [] : [`
`], ..._b(n));
  }), t;
}
function _b({ vnode: e, recurseCount: t }) {
  const n = t > 0 ? `... (${t} recursive calls)` : "", r = e.component ? e.component.parent == null : !1, o = ` at <${ul(
    e.component,
    e.type,
    r
  )}`, i = ">" + n;
  return e.props ? [o, ...Ib(e.props), i] : [o + i];
}
function Ib(e) {
  const t = [], n = Object.keys(e);
  return n.slice(0, 3).forEach((r) => {
    t.push(...Fp(r, e[r]));
  }), n.length > 3 && t.push(" ..."), t;
}
function Fp(e, t, n) {
  return tt(t) ? (t = JSON.stringify(t), n ? t : [`${e}=${t}`]) : typeof t == "number" || typeof t == "boolean" || t == null ? n ? t : [`${e}=${t}`] : et(t) ? (t = Fp(e, Se(t.value), !0), n ? t : [`${e}=Ref<`, t, ">"]) : be(t) ? [`${e}=fn${t.name ? `<${t.name}>` : ""}`] : (t = Se(t), n ? t : [`${e}=`, t]);
}
function Nb(e, t) {
  M.NODE_ENV !== "production" && e !== void 0 && (typeof e != "number" ? Z(`${t} is not a valid number - got ${JSON.stringify(e)}.`) : isNaN(e) && Z(`${t} is NaN - the duration expression might be incorrect.`));
}
const Iu = {
  sp: "serverPrefetch hook",
  bc: "beforeCreate hook",
  c: "created hook",
  bm: "beforeMount hook",
  m: "mounted hook",
  bu: "beforeUpdate hook",
  u: "updated",
  bum: "beforeUnmount hook",
  um: "unmounted hook",
  a: "activated hook",
  da: "deactivated hook",
  ec: "errorCaptured hook",
  rtc: "renderTracked hook",
  rtg: "renderTriggered hook",
  0: "setup function",
  1: "render function",
  2: "watcher getter",
  3: "watcher callback",
  4: "watcher cleanup function",
  5: "native event handler",
  6: "component event handler",
  7: "vnode hook",
  8: "directive hook",
  9: "transition hook",
  10: "app errorHandler",
  11: "app warnHandler",
  12: "ref function",
  13: "async component loader",
  14: "scheduler flush. This is likely a Vue internals bug. Please open an issue at https://new-issue.vuejs.org/?repo=vuejs/core"
};
function En(e, t, n, r) {
  let o;
  try {
    o = r ? e(...r) : e();
  } catch (i) {
    nl(i, t, n);
  }
  return o;
}
function Kt(e, t, n, r) {
  if (be(e)) {
    const i = En(e, t, n, r);
    return i && vu(i) && i.catch((s) => {
      nl(s, t, n);
    }), i;
  }
  const o = [];
  for (let i = 0; i < e.length; i++)
    o.push(Kt(e[i], t, n, r));
  return o;
}
function nl(e, t, n, r = !0) {
  const o = t ? t.vnode : null;
  if (t) {
    let i = t.parent;
    const s = t.proxy, a = M.NODE_ENV !== "production" ? Iu[n] : n;
    for (; i; ) {
      const c = i.ec;
      if (c) {
        for (let u = 0; u < c.length; u++)
          if (c[u](e, s, a) === !1)
            return;
      }
      i = i.parent;
    }
    const l = t.appContext.config.errorHandler;
    if (l) {
      En(
        l,
        null,
        10,
        [e, s, a]
      );
      return;
    }
  }
  Tb(e, n, o, r);
}
function Tb(e, t, n, r = !0) {
  if (M.NODE_ENV !== "production") {
    const o = Iu[t];
    if (n && ta(n), Z(`Unhandled error${o ? ` during execution of ${o}` : ""}`), n && na(), r)
      throw e;
    console.error(e);
  } else
    console.error(e);
}
let Bi = !1, ac = !1;
const xt = [];
let cn = 0;
const wo = [];
let sn = null, Vn = 0;
const Bp = /* @__PURE__ */ Promise.resolve();
let Nu = null;
const Ob = 100;
function Li(e) {
  const t = Nu || Bp;
  return e ? t.then(this ? e.bind(this) : e) : t;
}
function Ab(e) {
  let t = cn + 1, n = xt.length;
  for (; t < n; ) {
    const r = t + n >>> 1, o = xt[r], i = Vi(o);
    i < e || i === e && o.pre ? t = r + 1 : n = r;
  }
  return t;
}
function rl(e) {
  (!xt.length || !xt.includes(
    e,
    Bi && e.allowRecurse ? cn + 1 : cn
  )) && (e.id == null ? xt.push(e) : xt.splice(Ab(e.id), 0, e), Lp());
}
function Lp() {
  !Bi && !ac && (ac = !0, Nu = Bp.then(jp));
}
function Db(e) {
  const t = xt.indexOf(e);
  t > cn && xt.splice(t, 1);
}
function Vp(e) {
  ge(e) ? wo.push(...e) : (!sn || !sn.includes(
    e,
    e.allowRecurse ? Vn + 1 : Vn
  )) && wo.push(e), Lp();
}
function Id(e, t, n = Bi ? cn + 1 : 0) {
  for (M.NODE_ENV !== "production" && (t = t || /* @__PURE__ */ new Map()); n < xt.length; n++) {
    const r = xt[n];
    if (r && r.pre) {
      if (e && r.id !== e.uid || M.NODE_ENV !== "production" && Tu(t, r))
        continue;
      xt.splice(n, 1), n--, r();
    }
  }
}
function zp(e) {
  if (wo.length) {
    const t = [...new Set(wo)];
    if (wo.length = 0, sn) {
      sn.push(...t);
      return;
    }
    for (sn = t, M.NODE_ENV !== "production" && (e = e || /* @__PURE__ */ new Map()), sn.sort((n, r) => Vi(n) - Vi(r)), Vn = 0; Vn < sn.length; Vn++)
      M.NODE_ENV !== "production" && Tu(e, sn[Vn]) || sn[Vn]();
    sn = null, Vn = 0;
  }
}
const Vi = (e) => e.id == null ? 1 / 0 : e.id, Mb = (e, t) => {
  const n = Vi(e) - Vi(t);
  if (n === 0) {
    if (e.pre && !t.pre)
      return -1;
    if (t.pre && !e.pre)
      return 1;
  }
  return n;
};
function jp(e) {
  ac = !1, Bi = !0, M.NODE_ENV !== "production" && (e = e || /* @__PURE__ */ new Map()), xt.sort(Mb);
  const t = M.NODE_ENV !== "production" ? (n) => Tu(e, n) : vt;
  try {
    for (cn = 0; cn < xt.length; cn++) {
      const n = xt[cn];
      if (n && n.active !== !1) {
        if (M.NODE_ENV !== "production" && t(n))
          continue;
        En(n, null, 14);
      }
    }
  } finally {
    cn = 0, xt.length = 0, zp(e), Bi = !1, Nu = null, (xt.length || wo.length) && jp(e);
  }
}
function Tu(e, t) {
  if (!e.has(t))
    e.set(t, 1);
  else {
    const n = e.get(t);
    if (n > Ob) {
      const r = t.ownerInstance, o = r && Em(r.type);
      return Z(
        `Maximum recursive updates exceeded${o ? ` in component <${o}>` : ""}. This means you have a reactive effect that is mutating its own dependencies and thus recursively triggering itself. Possible sources include component template, render function, updated hook or watcher source function.`
      ), !0;
    } else
      e.set(t, n + 1);
  }
}
let Zn = !1;
const so = /* @__PURE__ */ new Set();
M.NODE_ENV !== "production" && (ba().__VUE_HMR_RUNTIME__ = {
  createRecord: El(Hp),
  rerender: El(Rb),
  reload: El(Pb)
});
const Br = /* @__PURE__ */ new Map();
function $b(e) {
  const t = e.type.__hmrId;
  let n = Br.get(t);
  n || (Hp(t, e.type), n = Br.get(t)), n.instances.add(e);
}
function kb(e) {
  Br.get(e.type.__hmrId).instances.delete(e);
}
function Hp(e, t) {
  return Br.has(e) ? !1 : (Br.set(e, {
    initialDef: vi(t),
    instances: /* @__PURE__ */ new Set()
  }), !0);
}
function vi(e) {
  return _m(e) ? e.__vccOpts : e;
}
function Rb(e, t) {
  const n = Br.get(e);
  n && (n.initialDef.render = t, [...n.instances].forEach((r) => {
    t && (r.render = t, vi(r.type).render = t), r.renderCache = [], Zn = !0, r.update(), Zn = !1;
  }));
}
function Pb(e, t) {
  const n = Br.get(e);
  if (!n)
    return;
  t = vi(t), Nd(n.initialDef, t);
  const r = [...n.instances];
  for (const o of r) {
    const i = vi(o.type);
    so.has(i) || (i !== n.initialDef && Nd(i, t), so.add(i)), o.appContext.propsCache.delete(o.type), o.appContext.emitsCache.delete(o.type), o.appContext.optionsCache.delete(o.type), o.ceReload ? (so.add(i), o.ceReload(t.styles), so.delete(i)) : o.parent ? rl(o.parent.update) : o.appContext.reload ? o.appContext.reload() : typeof window < "u" ? window.location.reload() : console.warn(
      "[HMR] Root or manually mounted instance modified. Full reload required."
    );
  }
  Vp(() => {
    for (const o of r)
      so.delete(
        vi(o.type)
      );
  });
}
function Nd(e, t) {
  Ze(e, t);
  for (const n in e)
    n !== "__file" && !(n in t) && delete e[n];
}
function El(e) {
  return (t, n) => {
    try {
      return e(t, n);
    } catch (r) {
      console.error(r), console.warn(
        "[HMR] Something went wrong during Vue component hot-reload. Full reload required."
      );
    }
  };
}
let un, li = [], lc = !1;
function as(e, ...t) {
  un ? un.emit(e, ...t) : lc || li.push({ event: e, args: t });
}
function Wp(e, t) {
  var n, r;
  un = e, un ? (un.enabled = !0, li.forEach(({ event: o, args: i }) => un.emit(o, ...i)), li = []) : /* handle late devtools injection - only do this if we are in an actual */ /* browser environment to avoid the timer handle stalling test runner exit */ /* (#4815) */ typeof window < "u" && // some envs mock window but not fully
  window.HTMLElement && // also exclude jsdom
  !((r = (n = window.navigator) == null ? void 0 : n.userAgent) != null && r.includes("jsdom")) ? ((t.__VUE_DEVTOOLS_HOOK_REPLAY__ = t.__VUE_DEVTOOLS_HOOK_REPLAY__ || []).push((i) => {
    Wp(i, t);
  }), setTimeout(() => {
    un || (t.__VUE_DEVTOOLS_HOOK_REPLAY__ = null, lc = !0, li = []);
  }, 3e3)) : (lc = !0, li = []);
}
function Fb(e, t) {
  as("app:init", e, t, {
    Fragment: dt,
    Text: cs,
    Comment: gt,
    Static: ra
  });
}
function Bb(e) {
  as("app:unmount", e);
}
const Lb = /* @__PURE__ */ Ou(
  "component:added"
  /* COMPONENT_ADDED */
), Up = /* @__PURE__ */ Ou(
  "component:updated"
  /* COMPONENT_UPDATED */
), Vb = /* @__PURE__ */ Ou(
  "component:removed"
  /* COMPONENT_REMOVED */
), zb = (e) => {
  un && typeof un.cleanupBuffer == "function" && // remove the component if it wasn't buffered
  !un.cleanupBuffer(e) && Vb(e);
};
function Ou(e) {
  return (t) => {
    as(
      e,
      t.appContext.app,
      t.uid,
      t.parent ? t.parent.uid : void 0,
      t
    );
  };
}
const jb = /* @__PURE__ */ Kp(
  "perf:start"
  /* PERFORMANCE_START */
), Hb = /* @__PURE__ */ Kp(
  "perf:end"
  /* PERFORMANCE_END */
);
function Kp(e) {
  return (t, n, r) => {
    as(e, t.appContext.app, t.uid, t, n, r);
  };
}
function Wb(e, t, n) {
  as(
    "component:emit",
    e.appContext.app,
    e,
    t,
    n
  );
}
function Ub(e, t, ...n) {
  if (e.isUnmounted)
    return;
  const r = e.vnode.props || Ve;
  if (M.NODE_ENV !== "production") {
    const {
      emitsOptions: u,
      propsOptions: [d]
    } = e;
    if (u)
      if (!(t in u))
        (!d || !(mr(t) in d)) && Z(
          `Component emitted event "${t}" but it is neither declared in the emits option nor as an "${mr(t)}" prop.`
        );
      else {
        const f = u[t];
        be(f) && (f(...n) || Z(
          `Invalid event arguments: event validation failed for event "${t}".`
        ));
      }
  }
  let o = n;
  const i = t.startsWith("update:"), s = i && t.slice(7);
  if (s && s in r) {
    const u = `${s === "modelValue" ? "model" : s}Modifiers`, { number: d, trim: f } = r[u] || Ve;
    f && (o = n.map((m) => tt(m) ? m.trim() : m)), d && (o = n.map(My));
  }
  if (M.NODE_ENV !== "production" && Wb(e, t, o), M.NODE_ENV !== "production") {
    const u = t.toLowerCase();
    u !== t && r[mr(u)] && Z(
      `Event "${u}" is emitted in component ${ul(
        e,
        e.type
      )} but the handler is registered for "${t}". Note that HTML attributes are case-insensitive and you cannot use v-on to listen to camelCase events when using in-DOM templates. You should probably use "${Qn(t)}" instead of "${t}".`
    );
  }
  let a, l = r[a = mr(t)] || // also try camelCase event handler (#2249)
  r[a = mr(Oo(t))];
  !l && i && (l = r[a = mr(Qn(t))]), l && Kt(
    l,
    e,
    6,
    o
  );
  const c = r[a + "Once"];
  if (c) {
    if (!e.emitted)
      e.emitted = {};
    else if (e.emitted[a])
      return;
    e.emitted[a] = !0, Kt(
      c,
      e,
      6,
      o
    );
  }
}
function Gp(e, t, n = !1) {
  const r = t.emitsCache, o = r.get(e);
  if (o !== void 0)
    return o;
  const i = e.emits;
  let s = {}, a = !1;
  if (!be(e)) {
    const l = (c) => {
      const u = Gp(c, t, !0);
      u && (a = !0, Ze(s, u));
    };
    !n && t.mixins.length && t.mixins.forEach(l), e.extends && l(e.extends), e.mixins && e.mixins.forEach(l);
  }
  return !i && !a ? (ze(e) && r.set(e, null), null) : (ge(i) ? i.forEach((l) => s[l] = null) : Ze(s, i), ze(e) && r.set(e, s), s);
}
function ol(e, t) {
  return !e || !ss(t) ? !1 : (t = t.slice(2).replace(/Once$/, ""), Ne(e, t[0].toLowerCase() + t.slice(1)) || Ne(e, Qn(t)) || Ne(e, t));
}
let mt = null, Yp = null;
function xa(e) {
  const t = mt;
  return mt = e, Yp = e && e.type.__scopeId || null, t;
}
function ci(e, t = mt, n) {
  if (!t || e._n)
    return e;
  const r = (...o) => {
    r._d && zd(-1);
    const i = xa(t);
    let s;
    try {
      s = e(...o);
    } finally {
      xa(i), r._d && zd(1);
    }
    return M.NODE_ENV !== "production" && Up(t), s;
  };
  return r._n = !0, r._c = !0, r._d = !0, r;
}
let cc = !1;
function Sa() {
  cc = !0;
}
function _l(e) {
  const {
    type: t,
    vnode: n,
    proxy: r,
    withProxy: o,
    props: i,
    propsOptions: [s],
    slots: a,
    attrs: l,
    emit: c,
    render: u,
    renderCache: d,
    data: f,
    setupState: m,
    ctx: h,
    inheritAttrs: p
  } = e;
  let g, v;
  const y = xa(e);
  M.NODE_ENV !== "production" && (cc = !1);
  try {
    if (n.shapeFlag & 4) {
      const S = o || r, T = M.NODE_ENV !== "production" && m.__isScriptSetup ? new Proxy(S, {
        get(C, _, w) {
          return Z(
            `Property '${String(
              _
            )}' was accessed via 'this'. Avoid using 'this' in templates.`
          ), Reflect.get(C, _, w);
        }
      }) : S;
      g = Zt(
        u.call(
          T,
          S,
          d,
          i,
          m,
          f,
          h
        )
      ), v = l;
    } else {
      const S = t;
      M.NODE_ENV !== "production" && l === i && Sa(), g = Zt(
        S.length > 1 ? S(
          i,
          M.NODE_ENV !== "production" ? {
            get attrs() {
              return Sa(), l;
            },
            slots: a,
            emit: c
          } : { attrs: l, slots: a, emit: c }
        ) : S(
          i,
          null
          /* we know it doesn't need it */
        )
      ), v = t.props ? l : Gb(l);
    }
  } catch (S) {
    Ci.length = 0, nl(S, e, 1), g = Et(gt);
  }
  let b = g, E;
  if (M.NODE_ENV !== "production" && g.patchFlag > 0 && g.patchFlag & 2048 && ([b, E] = Kb(g)), v && p !== !1) {
    const S = Object.keys(v), { shapeFlag: T } = b;
    if (S.length) {
      if (T & 7)
        s && S.some(va) && (v = Yb(
          v,
          s
        )), b = en(b, v);
      else if (M.NODE_ENV !== "production" && !cc && b.type !== gt) {
        const C = Object.keys(l), _ = [], w = [];
        for (let R = 0, O = C.length; R < O; R++) {
          const I = C[R];
          ss(I) ? va(I) || _.push(I[2].toLowerCase() + I.slice(3)) : w.push(I);
        }
        w.length && Z(
          `Extraneous non-props attributes (${w.join(", ")}) were passed to component but could not be automatically inherited because component renders fragment or text root nodes.`
        ), _.length && Z(
          `Extraneous non-emits event listeners (${_.join(", ")}) were passed to component but could not be automatically inherited because component renders fragment or text root nodes. If the listener is intended to be a component custom event listener only, declare it using the "emits" option.`
        );
      }
    }
  }
  return n.dirs && (M.NODE_ENV !== "production" && !Td(b) && Z(
    "Runtime directive used on component with non-element root node. The directives will not function as intended."
  ), b = en(b), b.dirs = b.dirs ? b.dirs.concat(n.dirs) : n.dirs), n.transition && (M.NODE_ENV !== "production" && !Td(b) && Z(
    "Component inside <Transition> renders non-element root node that cannot be animated."
  ), b.transition = n.transition), M.NODE_ENV !== "production" && E ? E(b) : g = b, xa(y), g;
}
const Kb = (e) => {
  const t = e.children, n = e.dynamicChildren, r = qp(t);
  if (!r)
    return [e, void 0];
  const o = t.indexOf(r), i = n ? n.indexOf(r) : -1, s = (a) => {
    t[o] = a, n && (i > -1 ? n[i] = a : a.patchFlag > 0 && (e.dynamicChildren = [...n, a]));
  };
  return [Zt(r), s];
};
function qp(e) {
  let t;
  for (let n = 0; n < e.length; n++) {
    const r = e[n];
    if (Lr(r)) {
      if (r.type !== gt || r.children === "v-if") {
        if (t)
          return;
        t = r;
      }
    } else
      return;
  }
  return t;
}
const Gb = (e) => {
  let t;
  for (const n in e)
    (n === "class" || n === "style" || ss(n)) && ((t || (t = {}))[n] = e[n]);
  return t;
}, Yb = (e, t) => {
  const n = {};
  for (const r in e)
    (!va(r) || !(r.slice(9) in t)) && (n[r] = e[r]);
  return n;
}, Td = (e) => e.shapeFlag & 7 || e.type === gt;
function qb(e, t, n) {
  const { props: r, children: o, component: i } = e, { props: s, children: a, patchFlag: l } = t, c = i.emitsOptions;
  if (M.NODE_ENV !== "production" && (o || a) && Zn || t.dirs || t.transition)
    return !0;
  if (n && l >= 0) {
    if (l & 1024)
      return !0;
    if (l & 16)
      return r ? Od(r, s, c) : !!s;
    if (l & 8) {
      const u = t.dynamicProps;
      for (let d = 0; d < u.length; d++) {
        const f = u[d];
        if (s[f] !== r[f] && !ol(c, f))
          return !0;
      }
    }
  } else
    return (o || a) && (!a || !a.$stable) ? !0 : r === s ? !1 : r ? s ? Od(r, s, c) : !0 : !!s;
  return !1;
}
function Od(e, t, n) {
  const r = Object.keys(t);
  if (r.length !== Object.keys(e).length)
    return !0;
  for (let o = 0; o < r.length; o++) {
    const i = r[o];
    if (t[i] !== e[i] && !ol(n, i))
      return !0;
  }
  return !1;
}
function Zb({ vnode: e, parent: t }, n) {
  for (; t && t.subTree === e; )
    (e = t.vnode).el = n, t = t.parent;
}
const Xb = Symbol.for("v-ndc"), Jb = (e) => e.__isSuspense;
function Qb(e, t) {
  t && t.pendingBranch ? ge(e) ? t.effects.push(...e) : t.effects.push(e) : Vp(e);
}
function il(e, t) {
  return Au(e, null, t);
}
const Os = {};
function _n(e, t, n) {
  return M.NODE_ENV !== "production" && !be(t) && Z(
    "`watch(fn, options?)` signature has been moved to a separate API. Use `watchEffect(fn, options?)` instead. `watch` now only supports `watch(source, cb, options?) signature."
  ), Au(e, t, n);
}
function Au(e, t, { immediate: n, deep: r, flush: o, onTrack: i, onTrigger: s } = Ve) {
  var a;
  M.NODE_ENV !== "production" && !t && (n !== void 0 && Z(
    'watch() "immediate" option is only respected when using the watch(source, callback, options?) signature.'
  ), r !== void 0 && Z(
    'watch() "deep" option is only respected when using the watch(source, callback, options?) signature.'
  ));
  const l = (S) => {
    Z(
      "Invalid watch source: ",
      S,
      "A watch source can only be a getter/effect function, a ref, a reactive object, or an array of these types."
    );
  }, c = Ky() === ((a = pt) == null ? void 0 : a.scope) ? pt : null;
  let u, d = !1, f = !1;
  if (et(e) ? (u = () => e.value, d = wa(e)) : Tr(e) ? (u = () => e, r = !0) : ge(e) ? (f = !0, d = e.some((S) => Tr(S) || wa(S)), u = () => e.map((S) => {
    if (et(S))
      return S.value;
    if (Tr(S))
      return br(S);
    if (be(S))
      return En(S, c, 2);
    M.NODE_ENV !== "production" && l(S);
  })) : be(e) ? t ? u = () => En(e, c, 2) : u = () => {
    if (!(c && c.isUnmounted))
      return m && m(), Kt(
        e,
        c,
        3,
        [h]
      );
  } : (u = vt, M.NODE_ENV !== "production" && l(e)), t && r) {
    const S = u;
    u = () => br(S());
  }
  let m, h = (S) => {
    m = b.onStop = () => {
      En(S, c, 4), m = b.onStop = void 0;
    };
  }, p;
  if (Wi)
    if (h = vt, t ? n && Kt(t, c, 3, [
      u(),
      f ? [] : void 0,
      h
    ]) : u(), o === "sync") {
      const S = o1();
      p = S.__watcherHandles || (S.__watcherHandles = []);
    } else
      return vt;
  let g = f ? new Array(e.length).fill(Os) : Os;
  const v = () => {
    if (b.active)
      if (t) {
        const S = b.run();
        (r || d || (f ? S.some((T, C) => Fr(T, g[C])) : Fr(S, g))) && (m && m(), Kt(t, c, 3, [
          S,
          // pass undefined as the old value when it's changed for the first time
          g === Os ? void 0 : f && g[0] === Os ? [] : g,
          h
        ]), g = S);
      } else
        b.run();
  };
  v.allowRecurse = !!t;
  let y;
  o === "sync" ? y = v : o === "post" ? y = () => Ft(v, c && c.suspense) : (v.pre = !0, c && (v.id = c.uid), y = () => rl(v));
  const b = new xu(u, y);
  M.NODE_ENV !== "production" && (b.onTrack = i, b.onTrigger = s), t ? n ? v() : g = b.run() : o === "post" ? Ft(
    b.run.bind(b),
    c && c.suspense
  ) : b.run();
  const E = () => {
    b.stop(), c && c.scope && gu(c.scope.effects, b);
  };
  return p && p.push(E), E;
}
function e0(e, t, n) {
  const r = this.proxy, o = tt(e) ? e.includes(".") ? Zp(r, e) : () => r[e] : e.bind(r, r);
  let i;
  be(t) ? i = t : (i = t.handler, n = t);
  const s = pt;
  Ao(this);
  const a = Au(o, i.bind(r), n);
  return s ? Ao(s) : Dr(), a;
}
function Zp(e, t) {
  const n = t.split(".");
  return () => {
    let r = e;
    for (let o = 0; o < n.length && r; o++)
      r = r[n[o]];
    return r;
  };
}
function br(e, t) {
  if (!ze(e) || e.__v_skip || (t = t || /* @__PURE__ */ new Set(), t.has(e)))
    return e;
  if (t.add(e), et(e))
    br(e.value, t);
  else if (ge(e))
    for (let n = 0; n < e.length; n++)
      br(e[n], t);
  else if (Iy(e) || Co(e))
    e.forEach((n) => {
      br(n, t);
    });
  else if (Ty(e))
    for (const n in e)
      br(e[n], t);
  return e;
}
function Xp(e) {
  Oy(e) && Z("Do not use built-in directive ids as custom directive id: " + e);
}
function uc(e, t) {
  const n = mt;
  if (n === null)
    return M.NODE_ENV !== "production" && Z("withDirectives can only be used inside render functions."), e;
  const r = cl(n) || n.proxy, o = e.dirs || (e.dirs = []);
  for (let i = 0; i < t.length; i++) {
    let [s, a, l, c = Ve] = t[i];
    s && (be(s) && (s = {
      mounted: s,
      updated: s
    }), s.deep && br(a), o.push({
      dir: s,
      instance: r,
      value: a,
      oldValue: void 0,
      arg: l,
      modifiers: c
    }));
  }
  return e;
}
function cr(e, t, n, r) {
  const o = e.dirs, i = t && t.dirs;
  for (let s = 0; s < o.length; s++) {
    const a = o[s];
    i && (a.oldValue = i[s].value);
    let l = a.dir[r];
    l && (Kr(), Kt(l, n, 8, [
      e.el,
      a,
      e,
      t
    ]), Gr());
  }
}
const zn = Symbol("_leaveCb"), As = Symbol("_enterCb");
function Jp() {
  const e = {
    isMounted: !1,
    isLeaving: !1,
    isUnmounting: !1,
    leavingVNodes: /* @__PURE__ */ new Map()
  };
  return lr(() => {
    e.isMounted = !0;
  }), nn(() => {
    e.isUnmounting = !0;
  }), e;
}
const jt = [Function, Array], Qp = {
  mode: String,
  appear: Boolean,
  persisted: Boolean,
  // enter
  onBeforeEnter: jt,
  onEnter: jt,
  onAfterEnter: jt,
  onEnterCancelled: jt,
  // leave
  onBeforeLeave: jt,
  onLeave: jt,
  onAfterLeave: jt,
  onLeaveCancelled: jt,
  // appear
  onBeforeAppear: jt,
  onAppear: jt,
  onAfterAppear: jt,
  onAppearCancelled: jt
}, t0 = {
  name: "BaseTransition",
  props: Qp,
  setup(e, { slots: t }) {
    const n = ll(), r = Jp();
    let o;
    return () => {
      const i = t.default && Du(t.default(), !0);
      if (!i || !i.length)
        return;
      let s = i[0];
      if (i.length > 1) {
        let p = !1;
        for (const g of i)
          if (g.type !== gt) {
            if (M.NODE_ENV !== "production" && p) {
              Z(
                "<transition> can only be used on a single element or component. Use <transition-group> for lists."
              );
              break;
            }
            if (s = g, p = !0, M.NODE_ENV === "production")
              break;
          }
      }
      const a = Se(e), { mode: l } = a;
      if (M.NODE_ENV !== "production" && l && l !== "in-out" && l !== "out-in" && l !== "default" && Z(`invalid <transition> mode: ${l}`), r.isLeaving)
        return Il(s);
      const c = Ad(s);
      if (!c)
        return Il(s);
      const u = zi(
        c,
        a,
        r,
        n
      );
      ji(c, u);
      const d = n.subTree, f = d && Ad(d);
      let m = !1;
      const { getTransitionKey: h } = c.type;
      if (h) {
        const p = h();
        o === void 0 ? o = p : p !== o && (o = p, m = !0);
      }
      if (f && f.type !== gt && (!gr(c, f) || m)) {
        const p = zi(
          f,
          a,
          r,
          n
        );
        if (ji(f, p), l === "out-in")
          return r.isLeaving = !0, p.afterLeave = () => {
            r.isLeaving = !1, n.update.active !== !1 && n.update();
          }, Il(s);
        l === "in-out" && c.type !== gt && (p.delayLeave = (g, v, y) => {
          const b = em(
            r,
            f
          );
          b[String(f.key)] = f, g[zn] = () => {
            v(), g[zn] = void 0, delete u.delayedLeave;
          }, u.delayedLeave = y;
        });
      }
      return s;
    };
  }
}, n0 = t0;
function em(e, t) {
  const { leavingVNodes: n } = e;
  let r = n.get(t.type);
  return r || (r = /* @__PURE__ */ Object.create(null), n.set(t.type, r)), r;
}
function zi(e, t, n, r) {
  const {
    appear: o,
    mode: i,
    persisted: s = !1,
    onBeforeEnter: a,
    onEnter: l,
    onAfterEnter: c,
    onEnterCancelled: u,
    onBeforeLeave: d,
    onLeave: f,
    onAfterLeave: m,
    onLeaveCancelled: h,
    onBeforeAppear: p,
    onAppear: g,
    onAfterAppear: v,
    onAppearCancelled: y
  } = t, b = String(e.key), E = em(n, e), S = (_, w) => {
    _ && Kt(
      _,
      r,
      9,
      w
    );
  }, T = (_, w) => {
    const R = w[1];
    S(_, w), ge(_) ? _.every((O) => O.length <= 1) && R() : _.length <= 1 && R();
  }, C = {
    mode: i,
    persisted: s,
    beforeEnter(_) {
      let w = a;
      if (!n.isMounted)
        if (o)
          w = p || a;
        else
          return;
      _[zn] && _[zn](
        !0
        /* cancelled */
      );
      const R = E[b];
      R && gr(e, R) && R.el[zn] && R.el[zn](), S(w, [_]);
    },
    enter(_) {
      let w = l, R = c, O = u;
      if (!n.isMounted)
        if (o)
          w = g || l, R = v || c, O = y || u;
        else
          return;
      let I = !1;
      const L = _[As] = (D) => {
        I || (I = !0, D ? S(O, [_]) : S(R, [_]), C.delayedLeave && C.delayedLeave(), _[As] = void 0);
      };
      w ? T(w, [_, L]) : L();
    },
    leave(_, w) {
      const R = String(e.key);
      if (_[As] && _[As](
        !0
        /* cancelled */
      ), n.isUnmounting)
        return w();
      S(d, [_]);
      let O = !1;
      const I = _[zn] = (L) => {
        O || (O = !0, w(), L ? S(h, [_]) : S(m, [_]), _[zn] = void 0, E[R] === e && delete E[R]);
      };
      E[R] = e, f ? T(f, [_, I]) : I();
    },
    clone(_) {
      return zi(_, t, n, r);
    }
  };
  return C;
}
function Il(e) {
  if (ls(e))
    return e = en(e), e.children = null, e;
}
function Ad(e) {
  return ls(e) ? (
    // #7121 ensure get the child component subtree in case
    // it's been replaced during HMR
    M.NODE_ENV !== "production" && e.component ? e.component.subTree : e.children ? e.children[0] : void 0
  ) : e;
}
function ji(e, t) {
  e.shapeFlag & 6 && e.component ? ji(e.component.subTree, t) : e.shapeFlag & 128 ? (e.ssContent.transition = t.clone(e.ssContent), e.ssFallback.transition = t.clone(e.ssFallback)) : e.transition = t;
}
function Du(e, t = !1, n) {
  let r = [], o = 0;
  for (let i = 0; i < e.length; i++) {
    let s = e[i];
    const a = n == null ? s.key : String(n) + String(s.key != null ? s.key : i);
    s.type === dt ? (s.patchFlag & 128 && o++, r = r.concat(
      Du(s.children, t, a)
    )) : (t || s.type !== gt) && r.push(a != null ? en(s, { key: a }) : s);
  }
  if (o > 1)
    for (let i = 0; i < r.length; i++)
      r[i].patchFlag = -2;
  return r;
}
/*! #__NO_SIDE_EFFECTS__ */
// @__NO_SIDE_EFFECTS__
function bt(e, t) {
  return be(e) ? (
    // #8326: extend call and options.name access are considered side-effects
    // by Rollup, so we have to wrap it in a pure-annotated IIFE.
    Ze({ name: e.name }, t, { setup: e })
  ) : e;
}
const yi = (e) => !!e.type.__asyncLoader, ls = (e) => e.type.__isKeepAlive;
function tm(e, t) {
  rm(e, "a", t);
}
function nm(e, t) {
  rm(e, "da", t);
}
function rm(e, t, n = pt) {
  const r = e.__wdc || (e.__wdc = () => {
    let o = n;
    for (; o; ) {
      if (o.isDeactivated)
        return;
      o = o.parent;
    }
    return e();
  });
  if (sl(t, r, n), n) {
    let o = n.parent;
    for (; o && o.parent; )
      ls(o.parent.vnode) && r0(r, t, n, o), o = o.parent;
  }
}
function r0(e, t, n, r) {
  const o = sl(
    t,
    e,
    r,
    !0
    /* prepend */
  );
  im(() => {
    gu(r[t], o);
  }, n);
}
function sl(e, t, n = pt, r = !1) {
  if (n) {
    const o = n[e] || (n[e] = []), i = t.__weh || (t.__weh = (...s) => {
      if (n.isUnmounted)
        return;
      Kr(), Ao(n);
      const a = Kt(t, n, e, s);
      return Dr(), Gr(), a;
    });
    return r ? o.unshift(i) : o.push(i), i;
  } else if (M.NODE_ENV !== "production") {
    const o = mr(Iu[e].replace(/ hook$/, ""));
    Z(
      `${o} is called when there is no active component instance to be associated with. Lifecycle injection APIs can only be used during execution of setup(). If you are using async setup(), make sure to register lifecycle hooks before the first await statement.`
    );
  }
}
const Dn = (e) => (t, n = pt) => (
  // post-create lifecycle registrations are noops during SSR (except for serverPrefetch)
  (!Wi || e === "sp") && sl(e, (...r) => t(...r), n)
), Yr = Dn("bm"), lr = Dn("m"), o0 = Dn("bu"), om = Dn("u"), nn = Dn("bum"), im = Dn("um"), i0 = Dn("sp"), s0 = Dn(
  "rtg"
), a0 = Dn(
  "rtc"
);
function l0(e, t = pt) {
  sl("ec", e, t);
}
function c0(e, t, n = {}, r, o) {
  if (mt.isCE || mt.parent && yi(mt.parent) && mt.parent.isCE)
    return t !== "default" && (n.name = t), Et("slot", n, r && r());
  let i = e[t];
  M.NODE_ENV !== "production" && i && i.length > 1 && (Z(
    "SSR-optimized slot function detected in a non-SSR-optimized render function. You need to mark this component with $dynamic-slots in the parent template."
  ), i = () => []), i && i._c && (i._d = !1), vm();
  const s = i && sm(i(n)), a = H0(
    dt,
    {
      key: n.key || // slot content array of a dynamic conditional slot may have a branch
      // key attached in the `createSlots` helper, respect that
      s && s.key || `_${t}`
    },
    s || (r ? r() : []),
    s && e._ === 1 ? 64 : -2
  );
  return !o && a.scopeId && (a.slotScopeIds = [a.scopeId + "-s"]), i && i._c && (i._d = !0), a;
}
function sm(e) {
  return e.some((t) => Lr(t) ? !(t.type === gt || t.type === dt && !sm(t.children)) : !0) ? e : null;
}
const dc = (e) => e ? xm(e) ? cl(e) || e.proxy : dc(e.parent) : null, Ar = (
  // Move PURE marker to new line to workaround compiler discarding it
  // due to type annotation
  /* @__PURE__ */ Ze(/* @__PURE__ */ Object.create(null), {
    $: (e) => e,
    $el: (e) => e.vnode.el,
    $data: (e) => e.data,
    $props: (e) => M.NODE_ENV !== "production" ? ai(e.props) : e.props,
    $attrs: (e) => M.NODE_ENV !== "production" ? ai(e.attrs) : e.attrs,
    $slots: (e) => M.NODE_ENV !== "production" ? ai(e.slots) : e.slots,
    $refs: (e) => M.NODE_ENV !== "production" ? ai(e.refs) : e.refs,
    $parent: (e) => dc(e.parent),
    $root: (e) => dc(e.root),
    $emit: (e) => e.emit,
    $options: (e) => $u(e),
    $forceUpdate: (e) => e.f || (e.f = () => rl(e.update)),
    $nextTick: (e) => e.n || (e.n = Li.bind(e.proxy)),
    $watch: (e) => e0.bind(e)
  })
), Mu = (e) => e === "_" || e === "$", Nl = (e, t) => e !== Ve && !e.__isScriptSetup && Ne(e, t), am = {
  get({ _: e }, t) {
    const { ctx: n, setupState: r, data: o, props: i, accessCache: s, type: a, appContext: l } = e;
    if (M.NODE_ENV !== "production" && t === "__isVue")
      return !0;
    let c;
    if (t[0] !== "$") {
      const m = s[t];
      if (m !== void 0)
        switch (m) {
          case 1:
            return r[t];
          case 2:
            return o[t];
          case 4:
            return n[t];
          case 3:
            return i[t];
        }
      else {
        if (Nl(r, t))
          return s[t] = 1, r[t];
        if (o !== Ve && Ne(o, t))
          return s[t] = 2, o[t];
        if (
          // only cache other properties when instance has declared (thus stable)
          // props
          (c = e.propsOptions[0]) && Ne(c, t)
        )
          return s[t] = 3, i[t];
        if (n !== Ve && Ne(n, t))
          return s[t] = 4, n[t];
        fc && (s[t] = 0);
      }
    }
    const u = Ar[t];
    let d, f;
    if (u)
      return t === "$attrs" ? (yt(e, "get", t), M.NODE_ENV !== "production" && Sa()) : M.NODE_ENV !== "production" && t === "$slots" && yt(e, "get", t), u(e);
    if (
      // css module (injected by vue-loader)
      (d = a.__cssModules) && (d = d[t])
    )
      return d;
    if (n !== Ve && Ne(n, t))
      return s[t] = 4, n[t];
    if (
      // global properties
      f = l.config.globalProperties, Ne(f, t)
    )
      return f[t];
    M.NODE_ENV !== "production" && mt && (!tt(t) || // #1091 avoid internal isRef/isVNode checks on component instance leading
    // to infinite warning loop
    t.indexOf("__v") !== 0) && (o !== Ve && Mu(t[0]) && Ne(o, t) ? Z(
      `Property ${JSON.stringify(
        t
      )} must be accessed via $data because it starts with a reserved character ("$" or "_") and is not proxied on the render context.`
    ) : e === mt && Z(
      `Property ${JSON.stringify(t)} was accessed during render but is not defined on instance.`
    ));
  },
  set({ _: e }, t, n) {
    const { data: r, setupState: o, ctx: i } = e;
    return Nl(o, t) ? (o[t] = n, !0) : M.NODE_ENV !== "production" && o.__isScriptSetup && Ne(o, t) ? (Z(`Cannot mutate <script setup> binding "${t}" from Options API.`), !1) : r !== Ve && Ne(r, t) ? (r[t] = n, !0) : Ne(e.props, t) ? (M.NODE_ENV !== "production" && Z(`Attempting to mutate prop "${t}". Props are readonly.`), !1) : t[0] === "$" && t.slice(1) in e ? (M.NODE_ENV !== "production" && Z(
      `Attempting to mutate public property "${t}". Properties starting with $ are reserved and readonly.`
    ), !1) : (M.NODE_ENV !== "production" && t in e.appContext.config.globalProperties ? Object.defineProperty(i, t, {
      enumerable: !0,
      configurable: !0,
      value: n
    }) : i[t] = n, !0);
  },
  has({
    _: { data: e, setupState: t, accessCache: n, ctx: r, appContext: o, propsOptions: i }
  }, s) {
    let a;
    return !!n[s] || e !== Ve && Ne(e, s) || Nl(t, s) || (a = i[0]) && Ne(a, s) || Ne(r, s) || Ne(Ar, s) || Ne(o.config.globalProperties, s);
  },
  defineProperty(e, t, n) {
    return n.get != null ? e._.accessCache[t] = 0 : Ne(n, "value") && this.set(e, t, n.value, null), Reflect.defineProperty(e, t, n);
  }
};
M.NODE_ENV !== "production" && (am.ownKeys = (e) => (Z(
  "Avoid app logic that relies on enumerating keys on a component instance. The keys will be empty in production mode to avoid performance overhead."
), Reflect.ownKeys(e)));
function u0(e) {
  const t = {};
  return Object.defineProperty(t, "_", {
    configurable: !0,
    enumerable: !1,
    get: () => e
  }), Object.keys(Ar).forEach((n) => {
    Object.defineProperty(t, n, {
      configurable: !0,
      enumerable: !1,
      get: () => Ar[n](e),
      // intercepted by the proxy so no need for implementation,
      // but needed to prevent set errors
      set: vt
    });
  }), t;
}
function d0(e) {
  const {
    ctx: t,
    propsOptions: [n]
  } = e;
  n && Object.keys(n).forEach((r) => {
    Object.defineProperty(t, r, {
      enumerable: !0,
      configurable: !0,
      get: () => e.props[r],
      set: vt
    });
  });
}
function f0(e) {
  const { ctx: t, setupState: n } = e;
  Object.keys(Se(n)).forEach((r) => {
    if (!n.__isScriptSetup) {
      if (Mu(r[0])) {
        Z(
          `setup() return property ${JSON.stringify(
            r
          )} should not start with "$" or "_" which are reserved prefixes for Vue internals.`
        );
        return;
      }
      Object.defineProperty(t, r, {
        enumerable: !0,
        configurable: !0,
        get: () => n[r],
        set: vt
      });
    }
  });
}
function Dd(e) {
  return ge(e) ? e.reduce(
    (t, n) => (t[n] = null, t),
    {}
  ) : e;
}
function h0() {
  const e = /* @__PURE__ */ Object.create(null);
  return (t, n) => {
    e[n] ? Z(`${t} property "${n}" is already defined in ${e[n]}.`) : e[n] = t;
  };
}
let fc = !0;
function p0(e) {
  const t = $u(e), n = e.proxy, r = e.ctx;
  fc = !1, t.beforeCreate && Md(t.beforeCreate, e, "bc");
  const {
    // state
    data: o,
    computed: i,
    methods: s,
    watch: a,
    provide: l,
    inject: c,
    // lifecycle
    created: u,
    beforeMount: d,
    mounted: f,
    beforeUpdate: m,
    updated: h,
    activated: p,
    deactivated: g,
    beforeDestroy: v,
    beforeUnmount: y,
    destroyed: b,
    unmounted: E,
    render: S,
    renderTracked: T,
    renderTriggered: C,
    errorCaptured: _,
    serverPrefetch: w,
    // public API
    expose: R,
    inheritAttrs: O,
    // assets
    components: I,
    directives: L,
    filters: D
  } = t, P = M.NODE_ENV !== "production" ? h0() : null;
  if (M.NODE_ENV !== "production") {
    const [N] = e.propsOptions;
    if (N)
      for (const $ in N)
        P("Props", $);
  }
  if (c && m0(c, r, P), s)
    for (const N in s) {
      const $ = s[N];
      be($) ? (M.NODE_ENV !== "production" ? Object.defineProperty(r, N, {
        value: $.bind(n),
        configurable: !0,
        enumerable: !0,
        writable: !0
      }) : r[N] = $.bind(n), M.NODE_ENV !== "production" && P("Methods", N)) : M.NODE_ENV !== "production" && Z(
        `Method "${N}" has type "${typeof $}" in the component definition. Did you reference the function correctly?`
      );
    }
  if (o) {
    M.NODE_ENV !== "production" && !be(o) && Z(
      "The data option must be a function. Plain object usage is no longer supported."
    );
    const N = o.call(n, n);
    if (M.NODE_ENV !== "production" && vu(N) && Z(
      "data() returned a Promise - note data() cannot be async; If you intend to perform data fetching before component renders, use async setup() + <Suspense>."
    ), !ze(N))
      M.NODE_ENV !== "production" && Z("data() should return an object.");
    else if (e.data = Eu(N), M.NODE_ENV !== "production")
      for (const $ in N)
        P("Data", $), Mu($[0]) || Object.defineProperty(r, $, {
          configurable: !0,
          enumerable: !0,
          get: () => N[$],
          set: vt
        });
  }
  if (fc = !0, i)
    for (const N in i) {
      const $ = i[N], B = be($) ? $.bind(n, n) : be($.get) ? $.get.bind(n, n) : vt;
      M.NODE_ENV !== "production" && B === vt && Z(`Computed property "${N}" has no getter.`);
      const U = !be($) && be($.set) ? $.set.bind(n) : M.NODE_ENV !== "production" ? () => {
        Z(
          `Write operation failed: computed property "${N}" is readonly.`
        );
      } : vt, J = Te({
        get: B,
        set: U
      });
      Object.defineProperty(r, N, {
        enumerable: !0,
        configurable: !0,
        get: () => J.value,
        set: (te) => J.value = te
      }), M.NODE_ENV !== "production" && P("Computed", N);
    }
  if (a)
    for (const N in a)
      lm(a[N], r, n, N);
  if (l) {
    const N = be(l) ? l.call(n) : l;
    Reflect.ownKeys(N).forEach(($) => {
      xo($, N[$]);
    });
  }
  u && Md(u, e, "c");
  function k(N, $) {
    ge($) ? $.forEach((B) => N(B.bind(n))) : $ && N($.bind(n));
  }
  if (k(Yr, d), k(lr, f), k(o0, m), k(om, h), k(tm, p), k(nm, g), k(l0, _), k(a0, T), k(s0, C), k(nn, y), k(im, E), k(i0, w), ge(R))
    if (R.length) {
      const N = e.exposed || (e.exposed = {});
      R.forEach(($) => {
        Object.defineProperty(N, $, {
          get: () => n[$],
          set: (B) => n[$] = B
        });
      });
    } else
      e.exposed || (e.exposed = {});
  S && e.render === vt && (e.render = S), O != null && (e.inheritAttrs = O), I && (e.components = I), L && (e.directives = L);
}
function m0(e, t, n = vt) {
  ge(e) && (e = hc(e));
  for (const r in e) {
    const o = e[r];
    let i;
    ze(o) ? "default" in o ? i = $t(
      o.from || r,
      o.default,
      !0
      /* treat default function as factory */
    ) : i = $t(o.from || r) : i = $t(o), et(i) ? Object.defineProperty(t, r, {
      enumerable: !0,
      configurable: !0,
      get: () => i.value,
      set: (s) => i.value = s
    }) : t[r] = i, M.NODE_ENV !== "production" && n("Inject", r);
  }
}
function Md(e, t, n) {
  Kt(
    ge(e) ? e.map((r) => r.bind(t.proxy)) : e.bind(t.proxy),
    t,
    n
  );
}
function lm(e, t, n, r) {
  const o = r.includes(".") ? Zp(n, r) : () => n[r];
  if (tt(e)) {
    const i = t[e];
    be(i) ? _n(o, i) : M.NODE_ENV !== "production" && Z(`Invalid watch handler specified by key "${e}"`, i);
  } else if (be(e))
    _n(o, e.bind(n));
  else if (ze(e))
    if (ge(e))
      e.forEach((i) => lm(i, t, n, r));
    else {
      const i = be(e.handler) ? e.handler.bind(n) : t[e.handler];
      be(i) ? _n(o, i, e) : M.NODE_ENV !== "production" && Z(`Invalid watch handler specified by key "${e.handler}"`, i);
    }
  else
    M.NODE_ENV !== "production" && Z(`Invalid watch option: "${r}"`, e);
}
function $u(e) {
  const t = e.type, { mixins: n, extends: r } = t, {
    mixins: o,
    optionsCache: i,
    config: { optionMergeStrategies: s }
  } = e.appContext, a = i.get(t);
  let l;
  return a ? l = a : !o.length && !n && !r ? l = t : (l = {}, o.length && o.forEach(
    (c) => Ea(l, c, s, !0)
  ), Ea(l, t, s)), ze(t) && i.set(t, l), l;
}
function Ea(e, t, n, r = !1) {
  const { mixins: o, extends: i } = t;
  i && Ea(e, i, n, !0), o && o.forEach(
    (s) => Ea(e, s, n, !0)
  );
  for (const s in t)
    if (r && s === "expose")
      M.NODE_ENV !== "production" && Z(
        '"expose" option is ignored when declared in mixins or extends. It should only be declared in the base component itself.'
      );
    else {
      const a = g0[s] || n && n[s];
      e[s] = a ? a(e[s], t[s]) : t[s];
    }
  return e;
}
const g0 = {
  data: $d,
  props: kd,
  emits: kd,
  // objects
  methods: ui,
  computed: ui,
  // lifecycle
  beforeCreate: Nt,
  created: Nt,
  beforeMount: Nt,
  mounted: Nt,
  beforeUpdate: Nt,
  updated: Nt,
  beforeDestroy: Nt,
  beforeUnmount: Nt,
  destroyed: Nt,
  unmounted: Nt,
  activated: Nt,
  deactivated: Nt,
  errorCaptured: Nt,
  serverPrefetch: Nt,
  // assets
  components: ui,
  directives: ui,
  // watch
  watch: y0,
  // provide / inject
  provide: $d,
  inject: v0
};
function $d(e, t) {
  return t ? e ? function() {
    return Ze(
      be(e) ? e.call(this, this) : e,
      be(t) ? t.call(this, this) : t
    );
  } : t : e;
}
function v0(e, t) {
  return ui(hc(e), hc(t));
}
function hc(e) {
  if (ge(e)) {
    const t = {};
    for (let n = 0; n < e.length; n++)
      t[e[n]] = e[n];
    return t;
  }
  return e;
}
function Nt(e, t) {
  return e ? [...new Set([].concat(e, t))] : t;
}
function ui(e, t) {
  return e ? Ze(/* @__PURE__ */ Object.create(null), e, t) : t;
}
function kd(e, t) {
  return e ? ge(e) && ge(t) ? [.../* @__PURE__ */ new Set([...e, ...t])] : Ze(
    /* @__PURE__ */ Object.create(null),
    Dd(e),
    Dd(t ?? {})
  ) : t;
}
function y0(e, t) {
  if (!e)
    return t;
  if (!t)
    return e;
  const n = Ze(/* @__PURE__ */ Object.create(null), e);
  for (const r in t)
    n[r] = Nt(e[r], t[r]);
  return n;
}
function cm() {
  return {
    app: null,
    config: {
      isNativeTag: vp,
      performance: !1,
      globalProperties: {},
      optionMergeStrategies: {},
      errorHandler: void 0,
      warnHandler: void 0,
      compilerOptions: {}
    },
    mixins: [],
    components: {},
    directives: {},
    provides: /* @__PURE__ */ Object.create(null),
    optionsCache: /* @__PURE__ */ new WeakMap(),
    propsCache: /* @__PURE__ */ new WeakMap(),
    emitsCache: /* @__PURE__ */ new WeakMap()
  };
}
let b0 = 0;
function C0(e, t) {
  return function(r, o = null) {
    be(r) || (r = Ze({}, r)), o != null && !ze(o) && (M.NODE_ENV !== "production" && Z("root props passed to app.mount() must be an object."), o = null);
    const i = cm();
    M.NODE_ENV !== "production" && Object.defineProperty(i.config, "unwrapInjectedRef", {
      get() {
        return !0;
      },
      set() {
        Z(
          "app.config.unwrapInjectedRef has been deprecated. 3.3 now always unwraps injected refs in Options API."
        );
      }
    });
    const s = /* @__PURE__ */ new WeakSet();
    let a = !1;
    const l = i.app = {
      _uid: b0++,
      _component: r,
      _props: o,
      _container: null,
      _context: i,
      _instance: null,
      version: Ud,
      get config() {
        return i.config;
      },
      set config(c) {
        M.NODE_ENV !== "production" && Z(
          "app.config cannot be replaced. Modify individual options instead."
        );
      },
      use(c, ...u) {
        return s.has(c) ? M.NODE_ENV !== "production" && Z("Plugin has already been applied to target app.") : c && be(c.install) ? (s.add(c), c.install(l, ...u)) : be(c) ? (s.add(c), c(l, ...u)) : M.NODE_ENV !== "production" && Z(
          'A plugin must either be a function or an object with an "install" function.'
        ), l;
      },
      mixin(c) {
        return i.mixins.includes(c) ? M.NODE_ENV !== "production" && Z(
          "Mixin has already been applied to target app" + (c.name ? `: ${c.name}` : "")
        ) : i.mixins.push(c), l;
      },
      component(c, u) {
        return M.NODE_ENV !== "production" && yc(c, i.config), u ? (M.NODE_ENV !== "production" && i.components[c] && Z(`Component "${c}" has already been registered in target app.`), i.components[c] = u, l) : i.components[c];
      },
      directive(c, u) {
        return M.NODE_ENV !== "production" && Xp(c), u ? (M.NODE_ENV !== "production" && i.directives[c] && Z(`Directive "${c}" has already been registered in target app.`), i.directives[c] = u, l) : i.directives[c];
      },
      mount(c, u, d) {
        if (a)
          M.NODE_ENV !== "production" && Z(
            "App has already been mounted.\nIf you want to remount the same app, move your app creation logic into a factory function and create fresh app instances for each mount - e.g. `const createMyApp = () => createApp(App)`"
          );
        else {
          M.NODE_ENV !== "production" && c.__vue_app__ && Z(
            "There is already an app instance mounted on the host container.\n If you want to mount another app on the same host container, you need to unmount the previous app by calling `app.unmount()` first."
          );
          const f = Et(r, o);
          return f.appContext = i, M.NODE_ENV !== "production" && (i.reload = () => {
            e(en(f), c, d);
          }), u && t ? t(f, c) : e(f, c, d), a = !0, l._container = c, c.__vue_app__ = l, M.NODE_ENV !== "production" && (l._instance = f.component, Fb(l, Ud)), cl(f.component) || f.component.proxy;
        }
      },
      unmount() {
        a ? (e(null, l._container), M.NODE_ENV !== "production" && (l._instance = null, Bb(l)), delete l._container.__vue_app__) : M.NODE_ENV !== "production" && Z("Cannot unmount an app that is not mounted.");
      },
      provide(c, u) {
        return M.NODE_ENV !== "production" && c in i.provides && Z(
          `App already provides property with key "${String(c)}". It will be overwritten with the new value.`
        ), i.provides[c] = u, l;
      },
      runWithContext(c) {
        _a = l;
        try {
          return c();
        } finally {
          _a = null;
        }
      }
    };
    return l;
  };
}
let _a = null;
function xo(e, t) {
  if (!pt)
    M.NODE_ENV !== "production" && Z("provide() can only be used inside setup().");
  else {
    let n = pt.provides;
    const r = pt.parent && pt.parent.provides;
    r === n && (n = pt.provides = Object.create(r)), n[e] = t;
  }
}
function $t(e, t, n = !1) {
  const r = pt || mt;
  if (r || _a) {
    const o = r ? r.parent == null ? r.vnode.appContext && r.vnode.appContext.provides : r.parent.provides : _a._context.provides;
    if (o && e in o)
      return o[e];
    if (arguments.length > 1)
      return n && be(t) ? t.call(r && r.proxy) : t;
    M.NODE_ENV !== "production" && Z(`injection "${String(e)}" not found.`);
  } else
    M.NODE_ENV !== "production" && Z("inject() can only be used inside setup() or functional components.");
}
function w0(e, t, n, r = !1) {
  const o = {}, i = {};
  ya(i, al, 1), e.propsDefaults = /* @__PURE__ */ Object.create(null), um(e, t, o, i);
  for (const s in e.propsOptions[0])
    s in o || (o[s] = void 0);
  M.NODE_ENV !== "production" && fm(t || {}, o, e), n ? e.props = r ? o : pb(o) : e.type.props ? e.props = o : e.props = i, e.attrs = i;
}
function x0(e) {
  for (; e; ) {
    if (e.type.__hmrId)
      return !0;
    e = e.parent;
  }
}
function S0(e, t, n, r) {
  const {
    props: o,
    attrs: i,
    vnode: { patchFlag: s }
  } = e, a = Se(o), [l] = e.propsOptions;
  let c = !1;
  if (
    // always force full diff in dev
    // - #1942 if hmr is enabled with sfc component
    // - vite#872 non-sfc component used by sfc component
    !(M.NODE_ENV !== "production" && x0(e)) && (r || s > 0) && !(s & 16)
  ) {
    if (s & 8) {
      const u = e.vnode.dynamicProps;
      for (let d = 0; d < u.length; d++) {
        let f = u[d];
        if (ol(e.emitsOptions, f))
          continue;
        const m = t[f];
        if (l)
          if (Ne(i, f))
            m !== i[f] && (i[f] = m, c = !0);
          else {
            const h = Oo(f);
            o[h] = pc(
              l,
              a,
              h,
              m,
              e,
              !1
              /* isAbsent */
            );
          }
        else
          m !== i[f] && (i[f] = m, c = !0);
      }
    }
  } else {
    um(e, t, o, i) && (c = !0);
    let u;
    for (const d in a)
      (!t || // for camelCase
      !Ne(t, d) && // it's possible the original props was passed in as kebab-case
      // and converted to camelCase (#955)
      ((u = Qn(d)) === d || !Ne(t, u))) && (l ? n && // for camelCase
      (n[d] !== void 0 || // for kebab-case
      n[u] !== void 0) && (o[d] = pc(
        l,
        a,
        d,
        void 0,
        e,
        !0
        /* isAbsent */
      )) : delete o[d]);
    if (i !== a)
      for (const d in i)
        (!t || !Ne(t, d)) && (delete i[d], c = !0);
  }
  c && dn(e, "set", "$attrs"), M.NODE_ENV !== "production" && fm(t || {}, o, e);
}
function um(e, t, n, r) {
  const [o, i] = e.propsOptions;
  let s = !1, a;
  if (t)
    for (let l in t) {
      if (ea(l))
        continue;
      const c = t[l];
      let u;
      o && Ne(o, u = Oo(l)) ? !i || !i.includes(u) ? n[u] = c : (a || (a = {}))[u] = c : ol(e.emitsOptions, l) || (!(l in r) || c !== r[l]) && (r[l] = c, s = !0);
    }
  if (i) {
    const l = Se(n), c = a || Ve;
    for (let u = 0; u < i.length; u++) {
      const d = i[u];
      n[d] = pc(
        o,
        l,
        d,
        c[d],
        e,
        !Ne(c, d)
      );
    }
  }
  return s;
}
function pc(e, t, n, r, o, i) {
  const s = e[n];
  if (s != null) {
    const a = Ne(s, "default");
    if (a && r === void 0) {
      const l = s.default;
      if (s.type !== Function && !s.skipFactory && be(l)) {
        const { propsDefaults: c } = o;
        n in c ? r = c[n] : (Ao(o), r = c[n] = l.call(
          null,
          t
        ), Dr());
      } else
        r = l;
    }
    s[
      0
      /* shouldCast */
    ] && (i && !a ? r = !1 : s[
      1
      /* shouldCastTrue */
    ] && (r === "" || r === Qn(n)) && (r = !0));
  }
  return r;
}
function dm(e, t, n = !1) {
  const r = t.propsCache, o = r.get(e);
  if (o)
    return o;
  const i = e.props, s = {}, a = [];
  let l = !1;
  if (!be(e)) {
    const u = (d) => {
      l = !0;
      const [f, m] = dm(d, t, !0);
      Ze(s, f), m && a.push(...m);
    };
    !n && t.mixins.length && t.mixins.forEach(u), e.extends && u(e.extends), e.mixins && e.mixins.forEach(u);
  }
  if (!i && !l)
    return ze(e) && r.set(e, bo), bo;
  if (ge(i))
    for (let u = 0; u < i.length; u++) {
      M.NODE_ENV !== "production" && !tt(i[u]) && Z("props must be strings when using array syntax.", i[u]);
      const d = Oo(i[u]);
      Rd(d) && (s[d] = Ve);
    }
  else if (i) {
    M.NODE_ENV !== "production" && !ze(i) && Z("invalid props options", i);
    for (const u in i) {
      const d = Oo(u);
      if (Rd(d)) {
        const f = i[u], m = s[d] = ge(f) || be(f) ? { type: f } : Ze({}, f);
        if (m) {
          const h = Fd(Boolean, m.type), p = Fd(String, m.type);
          m[
            0
            /* shouldCast */
          ] = h > -1, m[
            1
            /* shouldCastTrue */
          ] = p < 0 || h < p, (h > -1 || Ne(m, "default")) && a.push(d);
        }
      }
    }
  }
  const c = [s, a];
  return ze(e) && r.set(e, c), c;
}
function Rd(e) {
  return e[0] !== "$" ? !0 : (M.NODE_ENV !== "production" && Z(`Invalid prop name: "${e}" is a reserved property.`), !1);
}
function mc(e) {
  const t = e && e.toString().match(/^\s*(function|class) (\w+)/);
  return t ? t[2] : e === null ? "null" : "";
}
function Pd(e, t) {
  return mc(e) === mc(t);
}
function Fd(e, t) {
  return ge(t) ? t.findIndex((n) => Pd(n, e)) : be(t) && Pd(t, e) ? 0 : -1;
}
function fm(e, t, n) {
  const r = Se(t), o = n.propsOptions[0];
  for (const i in o) {
    let s = o[i];
    s != null && E0(
      i,
      r[i],
      s,
      !Ne(e, i) && !Ne(e, Qn(i))
    );
  }
}
function E0(e, t, n, r) {
  const { type: o, required: i, validator: s, skipCheck: a } = n;
  if (i && r) {
    Z('Missing required prop: "' + e + '"');
    return;
  }
  if (!(t == null && !i)) {
    if (o != null && o !== !0 && !a) {
      let l = !1;
      const c = ge(o) ? o : [o], u = [];
      for (let d = 0; d < c.length && !l; d++) {
        const { valid: f, expectedType: m } = I0(t, c[d]);
        u.push(m || ""), l = f;
      }
      if (!l) {
        Z(N0(e, t, u));
        return;
      }
    }
    s && !s(t) && Z('Invalid prop: custom validator check failed for prop "' + e + '".');
  }
}
const _0 = /* @__PURE__ */ ar(
  "String,Number,Boolean,Function,Symbol,BigInt"
);
function I0(e, t) {
  let n;
  const r = mc(t);
  if (_0(r)) {
    const o = typeof e;
    n = o === r.toLowerCase(), !n && o === "object" && (n = e instanceof t);
  } else
    r === "Object" ? n = ze(e) : r === "Array" ? n = ge(e) : r === "null" ? n = e === null : n = e instanceof t;
  return {
    valid: n,
    expectedType: r
  };
}
function N0(e, t, n) {
  if (n.length === 0)
    return `Prop type [] for prop "${e}" won't match anything. Did you mean to use type Array instead?`;
  let r = `Invalid prop: type check failed for prop "${e}". Expected ${n.map(Ja).join(" | ")}`;
  const o = n[0], i = yu(t), s = Bd(t, o), a = Bd(t, i);
  return n.length === 1 && Ld(o) && !T0(o, i) && (r += ` with value ${s}`), r += `, got ${i} `, Ld(i) && (r += `with value ${a}.`), r;
}
function Bd(e, t) {
  return t === "String" ? `"${e}"` : t === "Number" ? `${Number(e)}` : `${e}`;
}
function Ld(e) {
  return ["string", "number", "boolean"].some((n) => e.toLowerCase() === n);
}
function T0(...e) {
  return e.some((t) => t.toLowerCase() === "boolean");
}
const hm = (e) => e[0] === "_" || e === "$stable", ku = (e) => ge(e) ? e.map(Zt) : [Zt(e)], O0 = (e, t, n) => {
  if (t._n)
    return t;
  const r = ci((...o) => (M.NODE_ENV !== "production" && pt && Z(
    `Slot "${e}" invoked outside of the render function: this will not track dependencies used in the slot. Invoke the slot function inside the render function instead.`
  ), ku(t(...o))), n);
  return r._c = !1, r;
}, pm = (e, t, n) => {
  const r = e._ctx;
  for (const o in e) {
    if (hm(o))
      continue;
    const i = e[o];
    if (be(i))
      t[o] = O0(o, i, r);
    else if (i != null) {
      M.NODE_ENV !== "production" && Z(
        `Non-function value encountered for slot "${o}". Prefer function slots for better performance.`
      );
      const s = ku(i);
      t[o] = () => s;
    }
  }
}, mm = (e, t) => {
  M.NODE_ENV !== "production" && !ls(e.vnode) && Z(
    "Non-function value encountered for default slot. Prefer function slots for better performance."
  );
  const n = ku(t);
  e.slots.default = () => n;
}, A0 = (e, t) => {
  if (e.vnode.shapeFlag & 32) {
    const n = t._;
    n ? (e.slots = Se(t), ya(t, "_", n)) : pm(
      t,
      e.slots = {}
    );
  } else
    e.slots = {}, t && mm(e, t);
  ya(e.slots, al, 1);
}, D0 = (e, t, n) => {
  const { vnode: r, slots: o } = e;
  let i = !0, s = Ve;
  if (r.shapeFlag & 32) {
    const a = t._;
    a ? M.NODE_ENV !== "production" && Zn ? (Ze(o, t), dn(e, "set", "$slots")) : n && a === 1 ? i = !1 : (Ze(o, t), !n && a === 1 && delete o._) : (i = !t.$stable, pm(t, o)), s = t;
  } else
    t && (mm(e, t), s = { default: 1 });
  if (i)
    for (const a in o)
      !hm(a) && s[a] == null && delete o[a];
};
function gc(e, t, n, r, o = !1) {
  if (ge(e)) {
    e.forEach(
      (f, m) => gc(
        f,
        t && (ge(t) ? t[m] : t),
        n,
        r,
        o
      )
    );
    return;
  }
  if (yi(r) && !o)
    return;
  const i = r.shapeFlag & 4 ? cl(r.component) || r.component.proxy : r.el, s = o ? null : i, { i: a, r: l } = e;
  if (M.NODE_ENV !== "production" && !a) {
    Z(
      "Missing ref owner context. ref cannot be used on hoisted vnodes. A vnode with ref must be created inside the render function."
    );
    return;
  }
  const c = t && t.r, u = a.refs === Ve ? a.refs = {} : a.refs, d = a.setupState;
  if (c != null && c !== l && (tt(c) ? (u[c] = null, Ne(d, c) && (d[c] = null)) : et(c) && (c.value = null)), be(l))
    En(l, a, 12, [s, u]);
  else {
    const f = tt(l), m = et(l);
    if (f || m) {
      const h = () => {
        if (e.f) {
          const p = f ? Ne(d, l) ? d[l] : u[l] : l.value;
          o ? ge(p) && gu(p, i) : ge(p) ? p.includes(i) || p.push(i) : f ? (u[l] = [i], Ne(d, l) && (d[l] = u[l])) : (l.value = [i], e.k && (u[e.k] = l.value));
        } else
          f ? (u[l] = s, Ne(d, l) && (d[l] = s)) : m ? (l.value = s, e.k && (u[e.k] = s)) : M.NODE_ENV !== "production" && Z("Invalid template ref type:", l, `(${typeof l})`);
      };
      s ? (h.id = -1, Ft(h, n)) : h();
    } else
      M.NODE_ENV !== "production" && Z("Invalid template ref type:", l, `(${typeof l})`);
  }
}
let Jo, Un;
function yn(e, t) {
  e.appContext.config.performance && Ia() && Un.mark(`vue-${t}-${e.uid}`), M.NODE_ENV !== "production" && jb(e, t, Ia() ? Un.now() : Date.now());
}
function bn(e, t) {
  if (e.appContext.config.performance && Ia()) {
    const n = `vue-${t}-${e.uid}`, r = n + ":end";
    Un.mark(r), Un.measure(
      `<${ul(e, e.type)}> ${t}`,
      n,
      r
    ), Un.clearMarks(n), Un.clearMarks(r);
  }
  M.NODE_ENV !== "production" && Hb(e, t, Ia() ? Un.now() : Date.now());
}
function Ia() {
  return Jo !== void 0 || (typeof window < "u" && window.performance ? (Jo = !0, Un = window.performance) : Jo = !1), Jo;
}
function M0() {
  const e = [];
  if (M.NODE_ENV !== "production" && e.length) {
    const t = e.length > 1;
    console.warn(
      `Feature flag${t ? "s" : ""} ${e.join(", ")} ${t ? "are" : "is"} not explicitly defined. You are running the esm-bundler build of Vue, which expects these compile-time feature flags to be globally injected via the bundler config in order to get better tree-shaking in the production bundle.

For more details, see https://link.vuejs.org/feature-flags.`
    );
  }
}
const Ft = Qb;
function $0(e) {
  return k0(e);
}
function k0(e, t) {
  M0();
  const n = ba();
  n.__VUE__ = !0, M.NODE_ENV !== "production" && Wp(n.__VUE_DEVTOOLS_GLOBAL_HOOK__, n);
  const {
    insert: r,
    remove: o,
    patchProp: i,
    createElement: s,
    createText: a,
    createComment: l,
    setText: c,
    setElementText: u,
    parentNode: d,
    nextSibling: f,
    setScopeId: m = vt,
    insertStaticContent: h
  } = e, p = (x, A, F, H = null, W = null, X = null, Q = !1, V = null, G = M.NODE_ENV !== "production" && Zn ? !1 : !!A.dynamicChildren) => {
    if (x === A)
      return;
    x && !gr(x, A) && (H = ne(x), ie(x, W, X, !0), x = null), A.patchFlag === -2 && (G = !1, A.dynamicChildren = null);
    const { type: K, ref: ce, shapeFlag: re } = A;
    switch (K) {
      case cs:
        g(x, A, F, H);
        break;
      case gt:
        v(x, A, F, H);
        break;
      case ra:
        x == null ? y(A, F, H, Q) : M.NODE_ENV !== "production" && b(x, A, F, Q);
        break;
      case dt:
        L(
          x,
          A,
          F,
          H,
          W,
          X,
          Q,
          V,
          G
        );
        break;
      default:
        re & 1 ? T(
          x,
          A,
          F,
          H,
          W,
          X,
          Q,
          V,
          G
        ) : re & 6 ? D(
          x,
          A,
          F,
          H,
          W,
          X,
          Q,
          V,
          G
        ) : re & 64 || re & 128 ? K.process(
          x,
          A,
          F,
          H,
          W,
          X,
          Q,
          V,
          G,
          we
        ) : M.NODE_ENV !== "production" && Z("Invalid VNode type:", K, `(${typeof K})`);
    }
    ce != null && W && gc(ce, x && x.ref, X, A || x, !A);
  }, g = (x, A, F, H) => {
    if (x == null)
      r(
        A.el = a(A.children),
        F,
        H
      );
    else {
      const W = A.el = x.el;
      A.children !== x.children && c(W, A.children);
    }
  }, v = (x, A, F, H) => {
    x == null ? r(
      A.el = l(A.children || ""),
      F,
      H
    ) : A.el = x.el;
  }, y = (x, A, F, H) => {
    [x.el, x.anchor] = h(
      x.children,
      A,
      F,
      H,
      x.el,
      x.anchor
    );
  }, b = (x, A, F, H) => {
    if (A.children !== x.children) {
      const W = f(x.anchor);
      S(x), [A.el, A.anchor] = h(
        A.children,
        F,
        W,
        H
      );
    } else
      A.el = x.el, A.anchor = x.anchor;
  }, E = ({ el: x, anchor: A }, F, H) => {
    let W;
    for (; x && x !== A; )
      W = f(x), r(x, F, H), x = W;
    r(A, F, H);
  }, S = ({ el: x, anchor: A }) => {
    let F;
    for (; x && x !== A; )
      F = f(x), o(x), x = F;
    o(A);
  }, T = (x, A, F, H, W, X, Q, V, G) => {
    Q = Q || A.type === "svg", x == null ? C(
      A,
      F,
      H,
      W,
      X,
      Q,
      V,
      G
    ) : R(
      x,
      A,
      W,
      X,
      Q,
      V,
      G
    );
  }, C = (x, A, F, H, W, X, Q, V) => {
    let G, K;
    const { type: ce, props: re, shapeFlag: ue, transition: xe, dirs: Ie } = x;
    if (G = x.el = s(
      x.type,
      X,
      re && re.is,
      re
    ), ue & 8 ? u(G, x.children) : ue & 16 && w(
      x.children,
      G,
      null,
      H,
      W,
      X && ce !== "foreignObject",
      Q,
      V
    ), Ie && cr(x, null, H, "created"), _(G, x, x.scopeId, Q, H), re) {
      for (const Fe in re)
        Fe !== "value" && !ea(Fe) && i(
          G,
          Fe,
          null,
          re[Fe],
          X,
          x.children,
          H,
          W,
          pe
        );
      "value" in re && i(G, "value", null, re.value), (K = re.onVnodeBeforeMount) && rn(K, H, x);
    }
    M.NODE_ENV !== "production" && (Object.defineProperty(G, "__vnode", {
      value: x,
      enumerable: !1
    }), Object.defineProperty(G, "__vueParentComponent", {
      value: H,
      enumerable: !1
    })), Ie && cr(x, null, H, "beforeMount");
    const Pe = R0(W, xe);
    Pe && xe.beforeEnter(G), r(G, A, F), ((K = re && re.onVnodeMounted) || Pe || Ie) && Ft(() => {
      K && rn(K, H, x), Pe && xe.enter(G), Ie && cr(x, null, H, "mounted");
    }, W);
  }, _ = (x, A, F, H, W) => {
    if (F && m(x, F), H)
      for (let X = 0; X < H.length; X++)
        m(x, H[X]);
    if (W) {
      let X = W.subTree;
      if (M.NODE_ENV !== "production" && X.patchFlag > 0 && X.patchFlag & 2048 && (X = qp(X.children) || X), A === X) {
        const Q = W.vnode;
        _(
          x,
          Q,
          Q.scopeId,
          Q.slotScopeIds,
          W.parent
        );
      }
    }
  }, w = (x, A, F, H, W, X, Q, V, G = 0) => {
    for (let K = G; K < x.length; K++) {
      const ce = x[K] = V ? jn(x[K]) : Zt(x[K]);
      p(
        null,
        ce,
        A,
        F,
        H,
        W,
        X,
        Q,
        V
      );
    }
  }, R = (x, A, F, H, W, X, Q) => {
    const V = A.el = x.el;
    let { patchFlag: G, dynamicChildren: K, dirs: ce } = A;
    G |= x.patchFlag & 16;
    const re = x.props || Ve, ue = A.props || Ve;
    let xe;
    F && ur(F, !1), (xe = ue.onVnodeBeforeUpdate) && rn(xe, F, A, x), ce && cr(A, x, F, "beforeUpdate"), F && ur(F, !0), M.NODE_ENV !== "production" && Zn && (G = 0, Q = !1, K = null);
    const Ie = W && A.type !== "foreignObject";
    if (K ? (O(
      x.dynamicChildren,
      K,
      V,
      F,
      H,
      Ie,
      X
    ), M.NODE_ENV !== "production" && bi(x, A)) : Q || B(
      x,
      A,
      V,
      null,
      F,
      H,
      Ie,
      X,
      !1
    ), G > 0) {
      if (G & 16)
        I(
          V,
          A,
          re,
          ue,
          F,
          H,
          W
        );
      else if (G & 2 && re.class !== ue.class && i(V, "class", null, ue.class, W), G & 4 && i(V, "style", re.style, ue.style, W), G & 8) {
        const Pe = A.dynamicProps;
        for (let Fe = 0; Fe < Pe.length; Fe++) {
          const Xe = Pe[Fe], It = re[Xe], kn = ue[Xe];
          (kn !== It || Xe === "value") && i(
            V,
            Xe,
            It,
            kn,
            W,
            x.children,
            F,
            H,
            pe
          );
        }
      }
      G & 1 && x.children !== A.children && u(V, A.children);
    } else
      !Q && K == null && I(
        V,
        A,
        re,
        ue,
        F,
        H,
        W
      );
    ((xe = ue.onVnodeUpdated) || ce) && Ft(() => {
      xe && rn(xe, F, A, x), ce && cr(A, x, F, "updated");
    }, H);
  }, O = (x, A, F, H, W, X, Q) => {
    for (let V = 0; V < A.length; V++) {
      const G = x[V], K = A[V], ce = (
        // oldVNode may be an errored async setup() component inside Suspense
        // which will not have a mounted element
        G.el && // - In the case of a Fragment, we need to provide the actual parent
        // of the Fragment itself so it can move its children.
        (G.type === dt || // - In the case of different nodes, there is going to be a replacement
        // which also requires the correct parent container
        !gr(G, K) || // - In the case of a component, it could contain anything.
        G.shapeFlag & 70) ? d(G.el) : (
          // In other cases, the parent container is not actually used so we
          // just pass the block element here to avoid a DOM parentNode call.
          F
        )
      );
      p(
        G,
        K,
        ce,
        null,
        H,
        W,
        X,
        Q,
        !0
      );
    }
  }, I = (x, A, F, H, W, X, Q) => {
    if (F !== H) {
      if (F !== Ve)
        for (const V in F)
          !ea(V) && !(V in H) && i(
            x,
            V,
            F[V],
            null,
            Q,
            A.children,
            W,
            X,
            pe
          );
      for (const V in H) {
        if (ea(V))
          continue;
        const G = H[V], K = F[V];
        G !== K && V !== "value" && i(
          x,
          V,
          K,
          G,
          Q,
          A.children,
          W,
          X,
          pe
        );
      }
      "value" in H && i(x, "value", F.value, H.value);
    }
  }, L = (x, A, F, H, W, X, Q, V, G) => {
    const K = A.el = x ? x.el : a(""), ce = A.anchor = x ? x.anchor : a("");
    let { patchFlag: re, dynamicChildren: ue, slotScopeIds: xe } = A;
    M.NODE_ENV !== "production" && // #5523 dev root fragment may inherit directives
    (Zn || re & 2048) && (re = 0, G = !1, ue = null), xe && (V = V ? V.concat(xe) : xe), x == null ? (r(K, F, H), r(ce, F, H), w(
      A.children,
      F,
      ce,
      W,
      X,
      Q,
      V,
      G
    )) : re > 0 && re & 64 && ue && // #2715 the previous fragment could've been a BAILed one as a result
    // of renderSlot() with no valid children
    x.dynamicChildren ? (O(
      x.dynamicChildren,
      ue,
      F,
      W,
      X,
      Q,
      V
    ), M.NODE_ENV !== "production" ? bi(x, A) : (
      // #2080 if the stable fragment has a key, it's a <template v-for> that may
      //  get moved around. Make sure all root level vnodes inherit el.
      // #2134 or if it's a component root, it may also get moved around
      // as the component is being moved.
      (A.key != null || W && A === W.subTree) && bi(
        x,
        A,
        !0
        /* shallow */
      )
    )) : B(
      x,
      A,
      F,
      ce,
      W,
      X,
      Q,
      V,
      G
    );
  }, D = (x, A, F, H, W, X, Q, V, G) => {
    A.slotScopeIds = V, x == null ? A.shapeFlag & 512 ? W.ctx.activate(
      A,
      F,
      H,
      Q,
      G
    ) : P(
      A,
      F,
      H,
      W,
      X,
      Q,
      G
    ) : k(x, A, G);
  }, P = (x, A, F, H, W, X, Q) => {
    const V = x.component = Y0(
      x,
      H,
      W
    );
    if (M.NODE_ENV !== "production" && V.type.__hmrId && $b(V), M.NODE_ENV !== "production" && (ta(x), yn(V, "mount")), ls(x) && (V.ctx.renderer = we), M.NODE_ENV !== "production" && yn(V, "init"), Z0(V), M.NODE_ENV !== "production" && bn(V, "init"), V.asyncDep) {
      if (W && W.registerDep(V, N), !x.el) {
        const G = V.subTree = Et(gt);
        v(null, G, A, F);
      }
      return;
    }
    N(
      V,
      x,
      A,
      F,
      W,
      X,
      Q
    ), M.NODE_ENV !== "production" && (na(), bn(V, "mount"));
  }, k = (x, A, F) => {
    const H = A.component = x.component;
    if (qb(x, A, F))
      if (H.asyncDep && !H.asyncResolved) {
        M.NODE_ENV !== "production" && ta(A), $(H, A, F), M.NODE_ENV !== "production" && na();
        return;
      } else
        H.next = A, Db(H.update), H.update();
    else
      A.el = x.el, H.vnode = A;
  }, N = (x, A, F, H, W, X, Q) => {
    const V = () => {
      if (x.isMounted) {
        let { next: ce, bu: re, u: ue, parent: xe, vnode: Ie } = x, Pe = ce, Fe;
        M.NODE_ENV !== "production" && ta(ce || x.vnode), ur(x, !1), ce ? (ce.el = Ie.el, $(x, ce, Q)) : ce = Ie, re && Xo(re), (Fe = ce.props && ce.props.onVnodeBeforeUpdate) && rn(Fe, xe, ce, Ie), ur(x, !0), M.NODE_ENV !== "production" && yn(x, "render");
        const Xe = _l(x);
        M.NODE_ENV !== "production" && bn(x, "render");
        const It = x.subTree;
        x.subTree = Xe, M.NODE_ENV !== "production" && yn(x, "patch"), p(
          It,
          Xe,
          // parent may have changed if it's in a teleport
          d(It.el),
          // anchor may have changed if it's in a fragment
          ne(It),
          x,
          W,
          X
        ), M.NODE_ENV !== "production" && bn(x, "patch"), ce.el = Xe.el, Pe === null && Zb(x, Xe.el), ue && Ft(ue, W), (Fe = ce.props && ce.props.onVnodeUpdated) && Ft(
          () => rn(Fe, xe, ce, Ie),
          W
        ), M.NODE_ENV !== "production" && Up(x), M.NODE_ENV !== "production" && na();
      } else {
        let ce;
        const { el: re, props: ue } = A, { bm: xe, m: Ie, parent: Pe } = x, Fe = yi(A);
        if (ur(x, !1), xe && Xo(xe), !Fe && (ce = ue && ue.onVnodeBeforeMount) && rn(ce, Pe, A), ur(x, !0), re && De) {
          const Xe = () => {
            M.NODE_ENV !== "production" && yn(x, "render"), x.subTree = _l(x), M.NODE_ENV !== "production" && bn(x, "render"), M.NODE_ENV !== "production" && yn(x, "hydrate"), De(
              re,
              x.subTree,
              x,
              W,
              null
            ), M.NODE_ENV !== "production" && bn(x, "hydrate");
          };
          Fe ? A.type.__asyncLoader().then(
            // note: we are moving the render call into an async callback,
            // which means it won't track dependencies - but it's ok because
            // a server-rendered async wrapper is already in resolved state
            // and it will never need to change.
            () => !x.isUnmounted && Xe()
          ) : Xe();
        } else {
          M.NODE_ENV !== "production" && yn(x, "render");
          const Xe = x.subTree = _l(x);
          M.NODE_ENV !== "production" && bn(x, "render"), M.NODE_ENV !== "production" && yn(x, "patch"), p(
            null,
            Xe,
            F,
            H,
            x,
            W,
            X
          ), M.NODE_ENV !== "production" && bn(x, "patch"), A.el = Xe.el;
        }
        if (Ie && Ft(Ie, W), !Fe && (ce = ue && ue.onVnodeMounted)) {
          const Xe = A;
          Ft(
            () => rn(ce, Pe, Xe),
            W
          );
        }
        (A.shapeFlag & 256 || Pe && yi(Pe.vnode) && Pe.vnode.shapeFlag & 256) && x.a && Ft(x.a, W), x.isMounted = !0, M.NODE_ENV !== "production" && Lb(x), A = F = H = null;
      }
    }, G = x.effect = new xu(
      V,
      () => rl(K),
      x.scope
      // track it in component's effect scope
    ), K = x.update = () => G.run();
    K.id = x.uid, ur(x, !0), M.NODE_ENV !== "production" && (G.onTrack = x.rtc ? (ce) => Xo(x.rtc, ce) : void 0, G.onTrigger = x.rtg ? (ce) => Xo(x.rtg, ce) : void 0, K.ownerInstance = x), K();
  }, $ = (x, A, F) => {
    A.component = x;
    const H = x.vnode.props;
    x.vnode = A, x.next = null, S0(x, A.props, H, F), D0(x, A.children, F), Kr(), Id(x), Gr();
  }, B = (x, A, F, H, W, X, Q, V, G = !1) => {
    const K = x && x.children, ce = x ? x.shapeFlag : 0, re = A.children, { patchFlag: ue, shapeFlag: xe } = A;
    if (ue > 0) {
      if (ue & 128) {
        J(
          K,
          re,
          F,
          H,
          W,
          X,
          Q,
          V,
          G
        );
        return;
      } else if (ue & 256) {
        U(
          K,
          re,
          F,
          H,
          W,
          X,
          Q,
          V,
          G
        );
        return;
      }
    }
    xe & 8 ? (ce & 16 && pe(K, W, X), re !== K && u(F, re)) : ce & 16 ? xe & 16 ? J(
      K,
      re,
      F,
      H,
      W,
      X,
      Q,
      V,
      G
    ) : pe(K, W, X, !0) : (ce & 8 && u(F, ""), xe & 16 && w(
      re,
      F,
      H,
      W,
      X,
      Q,
      V,
      G
    ));
  }, U = (x, A, F, H, W, X, Q, V, G) => {
    x = x || bo, A = A || bo;
    const K = x.length, ce = A.length, re = Math.min(K, ce);
    let ue;
    for (ue = 0; ue < re; ue++) {
      const xe = A[ue] = G ? jn(A[ue]) : Zt(A[ue]);
      p(
        x[ue],
        xe,
        F,
        null,
        W,
        X,
        Q,
        V,
        G
      );
    }
    K > ce ? pe(
      x,
      W,
      X,
      !0,
      !1,
      re
    ) : w(
      A,
      F,
      H,
      W,
      X,
      Q,
      V,
      G,
      re
    );
  }, J = (x, A, F, H, W, X, Q, V, G) => {
    let K = 0;
    const ce = A.length;
    let re = x.length - 1, ue = ce - 1;
    for (; K <= re && K <= ue; ) {
      const xe = x[K], Ie = A[K] = G ? jn(A[K]) : Zt(A[K]);
      if (gr(xe, Ie))
        p(
          xe,
          Ie,
          F,
          null,
          W,
          X,
          Q,
          V,
          G
        );
      else
        break;
      K++;
    }
    for (; K <= re && K <= ue; ) {
      const xe = x[re], Ie = A[ue] = G ? jn(A[ue]) : Zt(A[ue]);
      if (gr(xe, Ie))
        p(
          xe,
          Ie,
          F,
          null,
          W,
          X,
          Q,
          V,
          G
        );
      else
        break;
      re--, ue--;
    }
    if (K > re) {
      if (K <= ue) {
        const xe = ue + 1, Ie = xe < ce ? A[xe].el : H;
        for (; K <= ue; )
          p(
            null,
            A[K] = G ? jn(A[K]) : Zt(A[K]),
            F,
            Ie,
            W,
            X,
            Q,
            V,
            G
          ), K++;
      }
    } else if (K > ue)
      for (; K <= re; )
        ie(x[K], W, X, !0), K++;
    else {
      const xe = K, Ie = K, Pe = /* @__PURE__ */ new Map();
      for (K = Ie; K <= ue; K++) {
        const Y = A[K] = G ? jn(A[K]) : Zt(A[K]);
        Y.key != null && (M.NODE_ENV !== "production" && Pe.has(Y.key) && Z(
          "Duplicate keys found during update:",
          JSON.stringify(Y.key),
          "Make sure keys are unique."
        ), Pe.set(Y.key, K));
      }
      let Fe, Xe = 0;
      const It = ue - Ie + 1;
      let kn = !1, qo = 0;
      const zt = new Array(It);
      for (K = 0; K < It; K++)
        zt[K] = 0;
      for (K = xe; K <= re; K++) {
        const Y = x[K];
        if (Xe >= It) {
          ie(Y, W, X, !0);
          continue;
        }
        let se;
        if (Y.key != null)
          se = Pe.get(Y.key);
        else
          for (Fe = Ie; Fe <= ue; Fe++)
            if (zt[Fe - Ie] === 0 && gr(Y, A[Fe])) {
              se = Fe;
              break;
            }
        se === void 0 ? ie(Y, W, X, !0) : (zt[se - Ie] = K + 1, se >= qo ? qo = se : kn = !0, p(
          Y,
          A[se],
          F,
          null,
          W,
          X,
          Q,
          V,
          G
        ), Xe++);
      }
      const Sl = kn ? P0(zt) : bo;
      for (Fe = Sl.length - 1, K = It - 1; K >= 0; K--) {
        const Y = Ie + K, se = A[Y], ye = Y + 1 < ce ? A[Y + 1].el : H;
        zt[K] === 0 ? p(
          null,
          se,
          F,
          ye,
          W,
          X,
          Q,
          V,
          G
        ) : kn && (Fe < 0 || K !== Sl[Fe] ? te(se, F, ye, 2) : Fe--);
      }
    }
  }, te = (x, A, F, H, W = null) => {
    const { el: X, type: Q, transition: V, children: G, shapeFlag: K } = x;
    if (K & 6) {
      te(x.component.subTree, A, F, H);
      return;
    }
    if (K & 128) {
      x.suspense.move(A, F, H);
      return;
    }
    if (K & 64) {
      Q.move(x, A, F, we);
      return;
    }
    if (Q === dt) {
      r(X, A, F);
      for (let re = 0; re < G.length; re++)
        te(G[re], A, F, H);
      r(x.anchor, A, F);
      return;
    }
    if (Q === ra) {
      E(x, A, F);
      return;
    }
    if (H !== 2 && K & 1 && V)
      if (H === 0)
        V.beforeEnter(X), r(X, A, F), Ft(() => V.enter(X), W);
      else {
        const { leave: re, delayLeave: ue, afterLeave: xe } = V, Ie = () => r(X, A, F), Pe = () => {
          re(X, () => {
            Ie(), xe && xe();
          });
        };
        ue ? ue(X, Ie, Pe) : Pe();
      }
    else
      r(X, A, F);
  }, ie = (x, A, F, H = !1, W = !1) => {
    const {
      type: X,
      props: Q,
      ref: V,
      children: G,
      dynamicChildren: K,
      shapeFlag: ce,
      patchFlag: re,
      dirs: ue
    } = x;
    if (V != null && gc(V, null, F, x, !0), ce & 256) {
      A.ctx.deactivate(x);
      return;
    }
    const xe = ce & 1 && ue, Ie = !yi(x);
    let Pe;
    if (Ie && (Pe = Q && Q.onVnodeBeforeUnmount) && rn(Pe, A, x), ce & 6)
      j(x.component, F, H);
    else {
      if (ce & 128) {
        x.suspense.unmount(F, H);
        return;
      }
      xe && cr(x, null, A, "beforeUnmount"), ce & 64 ? x.type.remove(
        x,
        A,
        F,
        W,
        we,
        H
      ) : K && // #1153: fast path should not be taken for non-stable (v-for) fragments
      (X !== dt || re > 0 && re & 64) ? pe(
        K,
        A,
        F,
        !1,
        !0
      ) : (X === dt && re & 384 || !W && ce & 16) && pe(G, A, F), H && z(x);
    }
    (Ie && (Pe = Q && Q.onVnodeUnmounted) || xe) && Ft(() => {
      Pe && rn(Pe, A, x), xe && cr(x, null, A, "unmounted");
    }, F);
  }, z = (x) => {
    const { type: A, el: F, anchor: H, transition: W } = x;
    if (A === dt) {
      M.NODE_ENV !== "production" && x.patchFlag > 0 && x.patchFlag & 2048 && W && !W.persisted ? x.children.forEach((Q) => {
        Q.type === gt ? o(Q.el) : z(Q);
      }) : le(F, H);
      return;
    }
    if (A === ra) {
      S(x);
      return;
    }
    const X = () => {
      o(F), W && !W.persisted && W.afterLeave && W.afterLeave();
    };
    if (x.shapeFlag & 1 && W && !W.persisted) {
      const { leave: Q, delayLeave: V } = W, G = () => Q(F, X);
      V ? V(x.el, X, G) : G();
    } else
      X();
  }, le = (x, A) => {
    let F;
    for (; x !== A; )
      F = f(x), o(x), x = F;
    o(A);
  }, j = (x, A, F) => {
    M.NODE_ENV !== "production" && x.type.__hmrId && kb(x);
    const { bum: H, scope: W, update: X, subTree: Q, um: V } = x;
    H && Xo(H), W.stop(), X && (X.active = !1, ie(Q, x, A, F)), V && Ft(V, A), Ft(() => {
      x.isUnmounted = !0;
    }, A), A && A.pendingBranch && !A.isUnmounted && x.asyncDep && !x.asyncResolved && x.suspenseId === A.pendingId && (A.deps--, A.deps === 0 && A.resolve()), M.NODE_ENV !== "production" && zb(x);
  }, pe = (x, A, F, H = !1, W = !1, X = 0) => {
    for (let Q = X; Q < x.length; Q++)
      ie(x[Q], A, F, H, W);
  }, ne = (x) => x.shapeFlag & 6 ? ne(x.component.subTree) : x.shapeFlag & 128 ? x.suspense.next() : f(x.anchor || x.el), ee = (x, A, F) => {
    x == null ? A._vnode && ie(A._vnode, null, null, !0) : p(A._vnode || null, x, A, null, null, null, F), Id(), zp(), A._vnode = x;
  }, we = {
    p,
    um: ie,
    m: te,
    r: z,
    mt: P,
    mc: w,
    pc: B,
    pbc: O,
    n: ne,
    o: e
  };
  let me, De;
  return t && ([me, De] = t(
    we
  )), {
    render: ee,
    hydrate: me,
    createApp: C0(ee, me)
  };
}
function ur({ effect: e, update: t }, n) {
  e.allowRecurse = t.allowRecurse = n;
}
function R0(e, t) {
  return (!e || e && !e.pendingBranch) && t && !t.persisted;
}
function bi(e, t, n = !1) {
  const r = e.children, o = t.children;
  if (ge(r) && ge(o))
    for (let i = 0; i < r.length; i++) {
      const s = r[i];
      let a = o[i];
      a.shapeFlag & 1 && !a.dynamicChildren && ((a.patchFlag <= 0 || a.patchFlag === 32) && (a = o[i] = jn(o[i]), a.el = s.el), n || bi(s, a)), a.type === cs && (a.el = s.el), M.NODE_ENV !== "production" && a.type === gt && !a.el && (a.el = s.el);
    }
}
function P0(e) {
  const t = e.slice(), n = [0];
  let r, o, i, s, a;
  const l = e.length;
  for (r = 0; r < l; r++) {
    const c = e[r];
    if (c !== 0) {
      if (o = n[n.length - 1], e[o] < c) {
        t[r] = o, n.push(r);
        continue;
      }
      for (i = 0, s = n.length - 1; i < s; )
        a = i + s >> 1, e[n[a]] < c ? i = a + 1 : s = a;
      c < e[n[i]] && (i > 0 && (t[r] = n[i - 1]), n[i] = r);
    }
  }
  for (i = n.length, s = n[i - 1]; i-- > 0; )
    n[i] = s, s = t[s];
  return n;
}
const F0 = (e) => e.__isTeleport, So = (e) => e && (e.disabled || e.disabled === ""), Vd = (e) => typeof SVGElement < "u" && e instanceof SVGElement, vc = (e, t) => {
  const n = e && e.to;
  if (tt(n))
    if (t) {
      const r = t(n);
      return r || M.NODE_ENV !== "production" && Z(
        `Failed to locate Teleport target with selector "${n}". Note the target element must exist before the component is mounted - i.e. the target cannot be rendered by the component itself, and ideally should be outside of the entire Vue component tree.`
      ), r;
    } else
      return M.NODE_ENV !== "production" && Z(
        "Current renderer does not support string target for Teleports. (missing querySelector renderer option)"
      ), null;
  else
    return M.NODE_ENV !== "production" && !n && !So(e) && Z(`Invalid Teleport target: ${n}`), n;
}, B0 = {
  name: "Teleport",
  __isTeleport: !0,
  process(e, t, n, r, o, i, s, a, l, c) {
    const {
      mc: u,
      pc: d,
      pbc: f,
      o: { insert: m, querySelector: h, createText: p, createComment: g }
    } = c, v = So(t.props);
    let { shapeFlag: y, children: b, dynamicChildren: E } = t;
    if (M.NODE_ENV !== "production" && Zn && (l = !1, E = null), e == null) {
      const S = t.el = M.NODE_ENV !== "production" ? g("teleport start") : p(""), T = t.anchor = M.NODE_ENV !== "production" ? g("teleport end") : p("");
      m(S, n, r), m(T, n, r);
      const C = t.target = vc(t.props, h), _ = t.targetAnchor = p("");
      C ? (m(_, C), s = s || Vd(C)) : M.NODE_ENV !== "production" && !v && Z("Invalid Teleport target on mount:", C, `(${typeof C})`);
      const w = (R, O) => {
        y & 16 && u(
          b,
          R,
          O,
          o,
          i,
          s,
          a,
          l
        );
      };
      v ? w(n, T) : C && w(C, _);
    } else {
      t.el = e.el;
      const S = t.anchor = e.anchor, T = t.target = e.target, C = t.targetAnchor = e.targetAnchor, _ = So(e.props), w = _ ? n : T, R = _ ? S : C;
      if (s = s || Vd(T), E ? (f(
        e.dynamicChildren,
        E,
        w,
        o,
        i,
        s,
        a
      ), bi(e, t, !0)) : l || d(
        e,
        t,
        w,
        R,
        o,
        i,
        s,
        a,
        !1
      ), v)
        _ ? t.props && e.props && t.props.to !== e.props.to && (t.props.to = e.props.to) : Ds(
          t,
          n,
          S,
          c,
          1
        );
      else if ((t.props && t.props.to) !== (e.props && e.props.to)) {
        const O = t.target = vc(
          t.props,
          h
        );
        O ? Ds(
          t,
          O,
          null,
          c,
          0
        ) : M.NODE_ENV !== "production" && Z(
          "Invalid Teleport target on update:",
          T,
          `(${typeof T})`
        );
      } else
        _ && Ds(
          t,
          T,
          C,
          c,
          1
        );
    }
    gm(t);
  },
  remove(e, t, n, r, { um: o, o: { remove: i } }, s) {
    const { shapeFlag: a, children: l, anchor: c, targetAnchor: u, target: d, props: f } = e;
    if (d && i(u), s && i(c), a & 16) {
      const m = s || !So(f);
      for (let h = 0; h < l.length; h++) {
        const p = l[h];
        o(
          p,
          t,
          n,
          m,
          !!p.dynamicChildren
        );
      }
    }
  },
  move: Ds,
  hydrate: L0
};
function Ds(e, t, n, { o: { insert: r }, m: o }, i = 2) {
  i === 0 && r(e.targetAnchor, t, n);
  const { el: s, anchor: a, shapeFlag: l, children: c, props: u } = e, d = i === 2;
  if (d && r(s, t, n), (!d || So(u)) && l & 16)
    for (let f = 0; f < c.length; f++)
      o(
        c[f],
        t,
        n,
        2
      );
  d && r(a, t, n);
}
function L0(e, t, n, r, o, i, {
  o: { nextSibling: s, parentNode: a, querySelector: l }
}, c) {
  const u = t.target = vc(
    t.props,
    l
  );
  if (u) {
    const d = u._lpa || u.firstChild;
    if (t.shapeFlag & 16)
      if (So(t.props))
        t.anchor = c(
          s(e),
          t,
          a(e),
          n,
          r,
          o,
          i
        ), t.targetAnchor = d;
      else {
        t.anchor = s(e);
        let f = d;
        for (; f; )
          if (f = s(f), f && f.nodeType === 8 && f.data === "teleport anchor") {
            t.targetAnchor = f, u._lpa = t.targetAnchor && s(t.targetAnchor);
            break;
          }
        c(
          d,
          t,
          u,
          n,
          r,
          o,
          i
        );
      }
    gm(t);
  }
  return t.anchor && s(t.anchor);
}
const V0 = B0;
function gm(e) {
  const t = e.ctx;
  if (t && t.ut) {
    let n = e.children[0].el;
    for (; n && n !== e.targetAnchor; )
      n.nodeType === 1 && n.setAttribute("data-v-owner", t.uid), n = n.nextSibling;
    t.ut();
  }
}
const dt = Symbol.for("v-fgt"), cs = Symbol.for("v-txt"), gt = Symbol.for("v-cmt"), ra = Symbol.for("v-stc"), Ci = [];
let Jt = null;
function vm(e = !1) {
  Ci.push(Jt = e ? null : []);
}
function z0() {
  Ci.pop(), Jt = Ci[Ci.length - 1] || null;
}
let Hi = 1;
function zd(e) {
  Hi += e;
}
function ym(e) {
  return e.dynamicChildren = Hi > 0 ? Jt || bo : null, z0(), Hi > 0 && Jt && Jt.push(e), e;
}
function j0(e, t, n, r, o, i) {
  return ym(
    vr(
      e,
      t,
      n,
      r,
      o,
      i,
      !0
      /* isBlock */
    )
  );
}
function H0(e, t, n, r, o) {
  return ym(
    Et(
      e,
      t,
      n,
      r,
      o,
      !0
      /* isBlock: prevent a block from tracking itself */
    )
  );
}
function Lr(e) {
  return e ? e.__v_isVNode === !0 : !1;
}
function gr(e, t) {
  return M.NODE_ENV !== "production" && t.shapeFlag & 6 && so.has(t.type) ? (e.shapeFlag &= -257, t.shapeFlag &= -513, !1) : e.type === t.type && e.key === t.key;
}
const W0 = (...e) => Cm(
  ...e
), al = "__vInternal", bm = ({ key: e }) => e ?? null, oa = ({
  ref: e,
  ref_key: t,
  ref_for: n
}) => (typeof e == "number" && (e = "" + e), e != null ? tt(e) || et(e) || be(e) ? { i: mt, r: e, k: t, f: !!n } : e : null);
function vr(e, t = null, n = null, r = 0, o = null, i = e === dt ? 0 : 1, s = !1, a = !1) {
  const l = {
    __v_isVNode: !0,
    __v_skip: !0,
    type: e,
    props: t,
    key: t && bm(t),
    ref: t && oa(t),
    scopeId: Yp,
    slotScopeIds: null,
    children: n,
    component: null,
    suspense: null,
    ssContent: null,
    ssFallback: null,
    dirs: null,
    transition: null,
    el: null,
    anchor: null,
    target: null,
    targetAnchor: null,
    staticCount: 0,
    shapeFlag: i,
    patchFlag: r,
    dynamicProps: o,
    dynamicChildren: null,
    appContext: null,
    ctx: mt
  };
  return a ? (Ru(l, n), i & 128 && e.normalize(l)) : n && (l.shapeFlag |= tt(n) ? 8 : 16), M.NODE_ENV !== "production" && l.key !== l.key && Z("VNode created with invalid key (NaN). VNode type:", l.type), Hi > 0 && // avoid a block node from tracking itself
  !s && // has current parent block
  Jt && // presence of a patch flag indicates this node needs patching on updates.
  // component nodes also should always be patched, because even if the
  // component doesn't need to update, it needs to persist the instance on to
  // the next vnode so that it can be properly unmounted later.
  (l.patchFlag > 0 || i & 6) && // the EVENTS flag is only for hydration and if it is the only flag, the
  // vnode should not be considered dynamic due to handler caching.
  l.patchFlag !== 32 && Jt.push(l), l;
}
const Et = M.NODE_ENV !== "production" ? W0 : Cm;
function Cm(e, t = null, n = null, r = 0, o = null, i = !1) {
  if ((!e || e === Xb) && (M.NODE_ENV !== "production" && !e && Z(`Invalid vnode type when creating vnode: ${e}.`), e = gt), Lr(e)) {
    const a = en(
      e,
      t,
      !0
      /* mergeRef: true */
    );
    return n && Ru(a, n), Hi > 0 && !i && Jt && (a.shapeFlag & 6 ? Jt[Jt.indexOf(e)] = a : Jt.push(a)), a.patchFlag |= -2, a;
  }
  if (_m(e) && (e = e.__vccOpts), t) {
    t = U0(t);
    let { class: a, style: l } = t;
    a && !tt(a) && (t.class = wu(a)), ze(l) && (sc(l) && !ge(l) && (l = Ze({}, l)), t.style = Cu(l));
  }
  const s = tt(e) ? 1 : Jb(e) ? 128 : F0(e) ? 64 : ze(e) ? 4 : be(e) ? 2 : 0;
  return M.NODE_ENV !== "production" && s & 4 && sc(e) && (e = Se(e), Z(
    "Vue received a Component that was made a reactive object. This can lead to unnecessary performance overhead and should be avoided by marking the component with `markRaw` or using `shallowRef` instead of `ref`.",
    `
Component that was made reactive: `,
    e
  )), vr(
    e,
    t,
    n,
    r,
    o,
    s,
    i,
    !0
  );
}
function U0(e) {
  return e ? sc(e) || al in e ? Ze({}, e) : e : null;
}
function en(e, t, n = !1) {
  const { props: r, ref: o, patchFlag: i, children: s } = e, a = t ? Pu(r || {}, t) : r;
  return {
    __v_isVNode: !0,
    __v_skip: !0,
    type: e.type,
    props: a,
    key: a && bm(a),
    ref: t && t.ref ? (
      // #2078 in the case of <component :is="vnode" ref="extra"/>
      // if the vnode itself already has a ref, cloneVNode will need to merge
      // the refs so the single vnode can be set on multiple refs
      n && o ? ge(o) ? o.concat(oa(t)) : [o, oa(t)] : oa(t)
    ) : o,
    scopeId: e.scopeId,
    slotScopeIds: e.slotScopeIds,
    children: M.NODE_ENV !== "production" && i === -1 && ge(s) ? s.map(wm) : s,
    target: e.target,
    targetAnchor: e.targetAnchor,
    staticCount: e.staticCount,
    shapeFlag: e.shapeFlag,
    // if the vnode is cloned with extra props, we can no longer assume its
    // existing patch flag to be reliable and need to add the FULL_PROPS flag.
    // note: preserve flag for fragments since they use the flag for children
    // fast paths only.
    patchFlag: t && e.type !== dt ? i === -1 ? 16 : i | 16 : i,
    dynamicProps: e.dynamicProps,
    dynamicChildren: e.dynamicChildren,
    appContext: e.appContext,
    dirs: e.dirs,
    transition: e.transition,
    // These should technically only be non-null on mounted VNodes. However,
    // they *should* be copied for kept-alive vnodes. So we just always copy
    // them since them being non-null during a mount doesn't affect the logic as
    // they will simply be overwritten.
    component: e.component,
    suspense: e.suspense,
    ssContent: e.ssContent && en(e.ssContent),
    ssFallback: e.ssFallback && en(e.ssFallback),
    el: e.el,
    anchor: e.anchor,
    ctx: e.ctx,
    ce: e.ce
  };
}
function wm(e) {
  const t = en(e);
  return ge(e.children) && (t.children = e.children.map(wm)), t;
}
function Na(e = " ", t = 0) {
  return Et(cs, null, e, t);
}
function Zt(e) {
  return e == null || typeof e == "boolean" ? Et(gt) : ge(e) ? Et(
    dt,
    null,
    // #3666, avoid reference pollution when reusing vnode
    e.slice()
  ) : typeof e == "object" ? jn(e) : Et(cs, null, String(e));
}
function jn(e) {
  return e.el === null && e.patchFlag !== -1 || e.memo ? e : en(e);
}
function Ru(e, t) {
  let n = 0;
  const { shapeFlag: r } = e;
  if (t == null)
    t = null;
  else if (ge(t))
    n = 16;
  else if (typeof t == "object")
    if (r & 65) {
      const o = t.default;
      o && (o._c && (o._d = !1), Ru(e, o()), o._c && (o._d = !0));
      return;
    } else {
      n = 32;
      const o = t._;
      !o && !(al in t) ? t._ctx = mt : o === 3 && mt && (mt.slots._ === 1 ? t._ = 1 : (t._ = 2, e.patchFlag |= 1024));
    }
  else
    be(t) ? (t = { default: t, _ctx: mt }, n = 32) : (t = String(t), r & 64 ? (n = 16, t = [Na(t)]) : n = 8);
  e.children = t, e.shapeFlag |= n;
}
function Pu(...e) {
  const t = {};
  for (let n = 0; n < e.length; n++) {
    const r = e[n];
    for (const o in r)
      if (o === "class")
        t.class !== r.class && (t.class = wu([t.class, r.class]));
      else if (o === "style")
        t.style = Cu([t.style, r.style]);
      else if (ss(o)) {
        const i = t[o], s = r[o];
        s && i !== s && !(ge(i) && i.includes(s)) && (t[o] = i ? [].concat(i, s) : s);
      } else
        o !== "" && (t[o] = r[o]);
  }
  return t;
}
function rn(e, t, n, r = null) {
  Kt(e, t, 7, [
    n,
    r
  ]);
}
const K0 = cm();
let G0 = 0;
function Y0(e, t, n) {
  const r = e.type, o = (t ? t.appContext : e.appContext) || K0, i = {
    uid: G0++,
    vnode: e,
    type: r,
    parent: t,
    appContext: o,
    root: null,
    // to be immediately set
    next: null,
    subTree: null,
    // will be set synchronously right after creation
    effect: null,
    update: null,
    // will be set synchronously right after creation
    scope: new Wy(
      !0
      /* detached */
    ),
    render: null,
    proxy: null,
    exposed: null,
    exposeProxy: null,
    withProxy: null,
    provides: t ? t.provides : Object.create(o.provides),
    accessCache: null,
    renderCache: [],
    // local resolved assets
    components: null,
    directives: null,
    // resolved props and emits options
    propsOptions: dm(r, o),
    emitsOptions: Gp(r, o),
    // emit
    emit: null,
    // to be set immediately
    emitted: null,
    // props default value
    propsDefaults: Ve,
    // inheritAttrs
    inheritAttrs: r.inheritAttrs,
    // state
    ctx: Ve,
    data: Ve,
    props: Ve,
    attrs: Ve,
    slots: Ve,
    refs: Ve,
    setupState: Ve,
    setupContext: null,
    attrsProxy: null,
    slotsProxy: null,
    // suspense related
    suspense: n,
    suspenseId: n ? n.pendingId : 0,
    asyncDep: null,
    asyncResolved: !1,
    // lifecycle hooks
    // not using enums here because it results in computed properties
    isMounted: !1,
    isUnmounted: !1,
    isDeactivated: !1,
    bc: null,
    c: null,
    bm: null,
    m: null,
    bu: null,
    u: null,
    um: null,
    bum: null,
    da: null,
    a: null,
    rtg: null,
    rtc: null,
    ec: null,
    sp: null
  };
  return M.NODE_ENV !== "production" ? i.ctx = u0(i) : i.ctx = { _: i }, i.root = t ? t.root : i, i.emit = Ub.bind(null, i), e.ce && e.ce(i), i;
}
let pt = null;
const ll = () => pt || mt;
let Fu, Xr, jd = "__VUE_INSTANCE_SETTERS__";
(Xr = ba()[jd]) || (Xr = ba()[jd] = []), Xr.push((e) => pt = e), Fu = (e) => {
  Xr.length > 1 ? Xr.forEach((t) => t(e)) : Xr[0](e);
};
const Ao = (e) => {
  Fu(e), e.scope.on();
}, Dr = () => {
  pt && pt.scope.off(), Fu(null);
}, q0 = /* @__PURE__ */ ar("slot,component");
function yc(e, t) {
  const n = t.isNativeTag || vp;
  (q0(e) || n(e)) && Z(
    "Do not use built-in or reserved HTML elements as component id: " + e
  );
}
function xm(e) {
  return e.vnode.shapeFlag & 4;
}
let Wi = !1;
function Z0(e, t = !1) {
  Wi = t;
  const { props: n, children: r } = e.vnode, o = xm(e);
  w0(e, n, o, t), A0(e, r);
  const i = o ? X0(e, t) : void 0;
  return Wi = !1, i;
}
function X0(e, t) {
  var n;
  const r = e.type;
  if (M.NODE_ENV !== "production") {
    if (r.name && yc(r.name, e.appContext.config), r.components) {
      const i = Object.keys(r.components);
      for (let s = 0; s < i.length; s++)
        yc(i[s], e.appContext.config);
    }
    if (r.directives) {
      const i = Object.keys(r.directives);
      for (let s = 0; s < i.length; s++)
        Xp(i[s]);
    }
    r.compilerOptions && J0() && Z(
      '"compilerOptions" is only supported when using a build of Vue that includes the runtime compiler. Since you are using a runtime-only build, the options should be passed via your build tool config instead.'
    );
  }
  e.accessCache = /* @__PURE__ */ Object.create(null), e.proxy = Dp(new Proxy(e.ctx, am)), M.NODE_ENV !== "production" && d0(e);
  const { setup: o } = r;
  if (o) {
    const i = e.setupContext = o.length > 1 ? e1(e) : null;
    Ao(e), Kr();
    const s = En(
      o,
      e,
      0,
      [M.NODE_ENV !== "production" ? ai(e.props) : e.props, i]
    );
    if (Gr(), Dr(), vu(s)) {
      if (s.then(Dr, Dr), t)
        return s.then((a) => {
          Hd(e, a, t);
        }).catch((a) => {
          nl(a, e, 0);
        });
      if (e.asyncDep = s, M.NODE_ENV !== "production" && !e.suspense) {
        const a = (n = r.name) != null ? n : "Anonymous";
        Z(
          `Component <${a}>: setup function returned a promise, but no <Suspense> boundary was found in the parent component tree. A component with async setup() must be nested in a <Suspense> in order to be rendered.`
        );
      }
    } else
      Hd(e, s, t);
  } else
    Sm(e, t);
}
function Hd(e, t, n) {
  be(t) ? e.type.__ssrInlineRender ? e.ssrRender = t : e.render = t : ze(t) ? (M.NODE_ENV !== "production" && Lr(t) && Z(
    "setup() should not return VNodes directly - return a render function instead."
  ), M.NODE_ENV !== "production" && (e.devtoolsRawSetupState = t), e.setupState = Pp(t), M.NODE_ENV !== "production" && f0(e)) : M.NODE_ENV !== "production" && t !== void 0 && Z(
    `setup() should return an object. Received: ${t === null ? "null" : typeof t}`
  ), Sm(e, n);
}
let bc;
const J0 = () => !bc;
function Sm(e, t, n) {
  const r = e.type;
  if (!e.render) {
    if (!t && bc && !r.render) {
      const o = r.template || $u(e).template;
      if (o) {
        M.NODE_ENV !== "production" && yn(e, "compile");
        const { isCustomElement: i, compilerOptions: s } = e.appContext.config, { delimiters: a, compilerOptions: l } = r, c = Ze(
          Ze(
            {
              isCustomElement: i,
              delimiters: a
            },
            s
          ),
          l
        );
        r.render = bc(o, c), M.NODE_ENV !== "production" && bn(e, "compile");
      }
    }
    e.render = r.render || vt;
  }
  {
    Ao(e), Kr();
    try {
      p0(e);
    } finally {
      Gr(), Dr();
    }
  }
  M.NODE_ENV !== "production" && !r.render && e.render === vt && !t && (r.template ? Z(
    'Component provided template option but runtime compilation is not supported in this build of Vue. Configure your bundler to alias "vue" to "vue/dist/vue.esm-bundler.js".'
    /* should not happen */
  ) : Z("Component is missing template or render function."));
}
function Wd(e) {
  return e.attrsProxy || (e.attrsProxy = new Proxy(
    e.attrs,
    M.NODE_ENV !== "production" ? {
      get(t, n) {
        return Sa(), yt(e, "get", "$attrs"), t[n];
      },
      set() {
        return Z("setupContext.attrs is readonly."), !1;
      },
      deleteProperty() {
        return Z("setupContext.attrs is readonly."), !1;
      }
    } : {
      get(t, n) {
        return yt(e, "get", "$attrs"), t[n];
      }
    }
  ));
}
function Q0(e) {
  return e.slotsProxy || (e.slotsProxy = new Proxy(e.slots, {
    get(t, n) {
      return yt(e, "get", "$slots"), t[n];
    }
  }));
}
function e1(e) {
  const t = (n) => {
    if (M.NODE_ENV !== "production" && (e.exposed && Z("expose() should be called only once per setup()."), n != null)) {
      let r = typeof n;
      r === "object" && (ge(n) ? r = "array" : et(n) && (r = "ref")), r !== "object" && Z(
        `expose() should be passed a plain object, received ${r}.`
      );
    }
    e.exposed = n || {};
  };
  return M.NODE_ENV !== "production" ? Object.freeze({
    get attrs() {
      return Wd(e);
    },
    get slots() {
      return Q0(e);
    },
    get emit() {
      return (n, ...r) => e.emit(n, ...r);
    },
    expose: t
  }) : {
    get attrs() {
      return Wd(e);
    },
    slots: e.slots,
    emit: e.emit,
    expose: t
  };
}
function cl(e) {
  if (e.exposed)
    return e.exposeProxy || (e.exposeProxy = new Proxy(Pp(Dp(e.exposed)), {
      get(t, n) {
        if (n in t)
          return t[n];
        if (n in Ar)
          return Ar[n](e);
      },
      has(t, n) {
        return n in t || n in Ar;
      }
    }));
}
const t1 = /(?:^|[-_])(\w)/g, n1 = (e) => e.replace(t1, (t) => t.toUpperCase()).replace(/[-_]/g, "");
function Em(e, t = !0) {
  return be(e) ? e.displayName || e.name : e.name || t && e.__name;
}
function ul(e, t, n = !1) {
  let r = Em(t);
  if (!r && t.__file) {
    const o = t.__file.match(/([^/\\]+)\.\w+$/);
    o && (r = o[1]);
  }
  if (!r && e && e.parent) {
    const o = (i) => {
      for (const s in i)
        if (i[s] === t)
          return s;
    };
    r = o(
      e.components || e.parent.type.components
    ) || o(e.appContext.components);
  }
  return r ? n1(r) : n ? "App" : "Anonymous";
}
function _m(e) {
  return be(e) && "__vccOpts" in e;
}
const Te = (e, t) => xb(e, t, Wi);
function q(e, t, n) {
  const r = arguments.length;
  return r === 2 ? ze(t) && !ge(t) ? Lr(t) ? Et(e, null, [t]) : Et(e, t) : Et(e, null, t) : (r > 3 ? n = Array.prototype.slice.call(arguments, 2) : r === 3 && Lr(n) && (n = [n]), Et(e, t, n));
}
const r1 = Symbol.for("v-scx"), o1 = () => {
  {
    const e = $t(r1);
    return e || M.NODE_ENV !== "production" && Z(
      "Server rendering context not provided. Make sure to only call useSSRContext() conditionally in the server build."
    ), e;
  }
};
function Tl(e) {
  return !!(e && e.__v_isShallow);
}
function i1() {
  if (M.NODE_ENV === "production" || typeof window > "u")
    return;
  const e = { style: "color:#3ba776" }, t = { style: "color:#1677ff" }, n = { style: "color:#f5222d" }, r = { style: "color:#eb2f96" }, o = {
    header(d) {
      return ze(d) ? d.__isVue ? ["div", e, "VueInstance"] : et(d) ? [
        "div",
        {},
        ["span", e, u(d)],
        "<",
        a(d.value),
        ">"
      ] : Tr(d) ? [
        "div",
        {},
        ["span", e, Tl(d) ? "ShallowReactive" : "Reactive"],
        "<",
        a(d),
        `>${tr(d) ? " (readonly)" : ""}`
      ] : tr(d) ? [
        "div",
        {},
        ["span", e, Tl(d) ? "ShallowReadonly" : "Readonly"],
        "<",
        a(d),
        ">"
      ] : null : null;
    },
    hasBody(d) {
      return d && d.__isVue;
    },
    body(d) {
      if (d && d.__isVue)
        return [
          "div",
          {},
          ...i(d.$)
        ];
    }
  };
  function i(d) {
    const f = [];
    d.type.props && d.props && f.push(s("props", Se(d.props))), d.setupState !== Ve && f.push(s("setup", d.setupState)), d.data !== Ve && f.push(s("data", Se(d.data)));
    const m = l(d, "computed");
    m && f.push(s("computed", m));
    const h = l(d, "inject");
    return h && f.push(s("injected", h)), f.push([
      "div",
      {},
      [
        "span",
        {
          style: r.style + ";opacity:0.66"
        },
        "$ (internal): "
      ],
      ["object", { object: d }]
    ]), f;
  }
  function s(d, f) {
    return f = Ze({}, f), Object.keys(f).length ? [
      "div",
      { style: "line-height:1.25em;margin-bottom:0.6em" },
      [
        "div",
        {
          style: "color:#476582"
        },
        d
      ],
      [
        "div",
        {
          style: "padding-left:1.25em"
        },
        ...Object.keys(f).map((m) => [
          "div",
          {},
          ["span", r, m + ": "],
          a(f[m], !1)
        ])
      ]
    ] : ["span", {}];
  }
  function a(d, f = !0) {
    return typeof d == "number" ? ["span", t, d] : typeof d == "string" ? ["span", n, JSON.stringify(d)] : typeof d == "boolean" ? ["span", r, d] : ze(d) ? ["object", { object: f ? Se(d) : d }] : ["span", n, String(d)];
  }
  function l(d, f) {
    const m = d.type;
    if (be(m))
      return;
    const h = {};
    for (const p in d.ctx)
      c(m, p, f) && (h[p] = d.ctx[p]);
    return h;
  }
  function c(d, f, m) {
    const h = d[m];
    if (ge(h) && h.includes(f) || ze(h) && f in h || d.extends && c(d.extends, f, m) || d.mixins && d.mixins.some((p) => c(p, f, m)))
      return !0;
  }
  function u(d) {
    return Tl(d) ? "ShallowRef" : d.effect ? "ComputedRef" : "Ref";
  }
  window.devtoolsFormatters ? window.devtoolsFormatters.push(o) : window.devtoolsFormatters = [o];
}
const Ud = "3.3.11";
var Vr = {};
const s1 = "http://www.w3.org/2000/svg", yr = typeof document < "u" ? document : null, Kd = yr && /* @__PURE__ */ yr.createElement("template"), a1 = {
  insert: (e, t, n) => {
    t.insertBefore(e, n || null);
  },
  remove: (e) => {
    const t = e.parentNode;
    t && t.removeChild(e);
  },
  createElement: (e, t, n, r) => {
    const o = t ? yr.createElementNS(s1, e) : yr.createElement(e, n ? { is: n } : void 0);
    return e === "select" && r && r.multiple != null && o.setAttribute("multiple", r.multiple), o;
  },
  createText: (e) => yr.createTextNode(e),
  createComment: (e) => yr.createComment(e),
  setText: (e, t) => {
    e.nodeValue = t;
  },
  setElementText: (e, t) => {
    e.textContent = t;
  },
  parentNode: (e) => e.parentNode,
  nextSibling: (e) => e.nextSibling,
  querySelector: (e) => yr.querySelector(e),
  setScopeId(e, t) {
    e.setAttribute(t, "");
  },
  // __UNSAFE__
  // Reason: innerHTML.
  // Static content here can only come from compiled templates.
  // As long as the user only uses trusted templates, this is safe.
  insertStaticContent(e, t, n, r, o, i) {
    const s = n ? n.previousSibling : t.lastChild;
    if (o && (o === i || o.nextSibling))
      for (; t.insertBefore(o.cloneNode(!0), n), !(o === i || !(o = o.nextSibling)); )
        ;
    else {
      Kd.innerHTML = r ? `<svg>${e}</svg>` : e;
      const a = Kd.content;
      if (r) {
        const l = a.firstChild;
        for (; l.firstChild; )
          a.appendChild(l.firstChild);
        a.removeChild(l);
      }
      t.insertBefore(a, n);
    }
    return [
      // first
      s ? s.nextSibling : t.firstChild,
      // last
      n ? n.previousSibling : t.lastChild
    ];
  }
}, Pn = "transition", Qo = "animation", Do = Symbol("_vtc"), rr = (e, { slots: t }) => q(n0, Nm(e), t);
rr.displayName = "Transition";
const Im = {
  name: String,
  type: String,
  css: {
    type: Boolean,
    default: !0
  },
  duration: [String, Number, Object],
  enterFromClass: String,
  enterActiveClass: String,
  enterToClass: String,
  appearFromClass: String,
  appearActiveClass: String,
  appearToClass: String,
  leaveFromClass: String,
  leaveActiveClass: String,
  leaveToClass: String
}, l1 = rr.props = /* @__PURE__ */ Ze(
  {},
  Qp,
  Im
), dr = (e, t = []) => {
  ge(e) ? e.forEach((n) => n(...t)) : e && e(...t);
}, Gd = (e) => e ? ge(e) ? e.some((t) => t.length > 1) : e.length > 1 : !1;
function Nm(e) {
  const t = {};
  for (const I in e)
    I in Im || (t[I] = e[I]);
  if (e.css === !1)
    return t;
  const {
    name: n = "v",
    type: r,
    duration: o,
    enterFromClass: i = `${n}-enter-from`,
    enterActiveClass: s = `${n}-enter-active`,
    enterToClass: a = `${n}-enter-to`,
    appearFromClass: l = i,
    appearActiveClass: c = s,
    appearToClass: u = a,
    leaveFromClass: d = `${n}-leave-from`,
    leaveActiveClass: f = `${n}-leave-active`,
    leaveToClass: m = `${n}-leave-to`
  } = e, h = c1(o), p = h && h[0], g = h && h[1], {
    onBeforeEnter: v,
    onEnter: y,
    onEnterCancelled: b,
    onLeave: E,
    onLeaveCancelled: S,
    onBeforeAppear: T = v,
    onAppear: C = y,
    onAppearCancelled: _ = b
  } = t, w = (I, L, D) => {
    Bn(I, L ? u : a), Bn(I, L ? c : s), D && D();
  }, R = (I, L) => {
    I._isLeaving = !1, Bn(I, d), Bn(I, m), Bn(I, f), L && L();
  }, O = (I) => (L, D) => {
    const P = I ? C : y, k = () => w(L, I, D);
    dr(P, [L, k]), Yd(() => {
      Bn(L, I ? l : i), Cn(L, I ? u : a), Gd(P) || qd(L, r, p, k);
    });
  };
  return Ze(t, {
    onBeforeEnter(I) {
      dr(v, [I]), Cn(I, i), Cn(I, s);
    },
    onBeforeAppear(I) {
      dr(T, [I]), Cn(I, l), Cn(I, c);
    },
    onEnter: O(!1),
    onAppear: O(!0),
    onLeave(I, L) {
      I._isLeaving = !0;
      const D = () => R(I, L);
      Cn(I, d), Om(), Cn(I, f), Yd(() => {
        I._isLeaving && (Bn(I, d), Cn(I, m), Gd(E) || qd(I, r, g, D));
      }), dr(E, [I, D]);
    },
    onEnterCancelled(I) {
      w(I, !1), dr(b, [I]);
    },
    onAppearCancelled(I) {
      w(I, !0), dr(_, [I]);
    },
    onLeaveCancelled(I) {
      R(I), dr(S, [I]);
    }
  });
}
function c1(e) {
  if (e == null)
    return null;
  if (ze(e))
    return [Ol(e.enter), Ol(e.leave)];
  {
    const t = Ol(e);
    return [t, t];
  }
}
function Ol(e) {
  const t = $y(e);
  return Vr.NODE_ENV !== "production" && Nb(t, "<transition> explicit duration"), t;
}
function Cn(e, t) {
  t.split(/\s+/).forEach((n) => n && e.classList.add(n)), (e[Do] || (e[Do] = /* @__PURE__ */ new Set())).add(t);
}
function Bn(e, t) {
  t.split(/\s+/).forEach((r) => r && e.classList.remove(r));
  const n = e[Do];
  n && (n.delete(t), n.size || (e[Do] = void 0));
}
function Yd(e) {
  requestAnimationFrame(() => {
    requestAnimationFrame(e);
  });
}
let u1 = 0;
function qd(e, t, n, r) {
  const o = e._endId = ++u1, i = () => {
    o === e._endId && r();
  };
  if (n)
    return setTimeout(i, n);
  const { type: s, timeout: a, propCount: l } = Tm(e, t);
  if (!s)
    return r();
  const c = s + "end";
  let u = 0;
  const d = () => {
    e.removeEventListener(c, f), i();
  }, f = (m) => {
    m.target === e && ++u >= l && d();
  };
  setTimeout(() => {
    u < l && d();
  }, a + 1), e.addEventListener(c, f);
}
function Tm(e, t) {
  const n = window.getComputedStyle(e), r = (h) => (n[h] || "").split(", "), o = r(`${Pn}Delay`), i = r(`${Pn}Duration`), s = Zd(o, i), a = r(`${Qo}Delay`), l = r(`${Qo}Duration`), c = Zd(a, l);
  let u = null, d = 0, f = 0;
  t === Pn ? s > 0 && (u = Pn, d = s, f = i.length) : t === Qo ? c > 0 && (u = Qo, d = c, f = l.length) : (d = Math.max(s, c), u = d > 0 ? s > c ? Pn : Qo : null, f = u ? u === Pn ? i.length : l.length : 0);
  const m = u === Pn && /\b(transform|all)(,|$)/.test(
    r(`${Pn}Property`).toString()
  );
  return {
    type: u,
    timeout: d,
    propCount: f,
    hasTransform: m
  };
}
function Zd(e, t) {
  for (; e.length < t.length; )
    e = e.concat(e);
  return Math.max(...t.map((n, r) => Xd(n) + Xd(e[r])));
}
function Xd(e) {
  return e === "auto" ? 0 : Number(e.slice(0, -1).replace(",", ".")) * 1e3;
}
function Om() {
  return document.body.offsetHeight;
}
function d1(e, t, n) {
  const r = e[Do];
  r && (t = (t ? [t, ...r] : [...r]).join(" ")), t == null ? e.removeAttribute("class") : n ? e.setAttribute("class", t) : e.className = t;
}
const Bu = Symbol("_vod"), Jd = {
  beforeMount(e, { value: t }, { transition: n }) {
    e[Bu] = e.style.display === "none" ? "" : e.style.display, n && t ? n.beforeEnter(e) : ei(e, t);
  },
  mounted(e, { value: t }, { transition: n }) {
    n && t && n.enter(e);
  },
  updated(e, { value: t, oldValue: n }, { transition: r }) {
    !t != !n && (r ? t ? (r.beforeEnter(e), ei(e, !0), r.enter(e)) : r.leave(e, () => {
      ei(e, !1);
    }) : ei(e, t));
  },
  beforeUnmount(e, { value: t }) {
    ei(e, t);
  }
};
function ei(e, t) {
  e.style.display = t ? e[Bu] : "none";
}
function f1(e, t, n) {
  const r = e.style, o = tt(n);
  if (n && !o) {
    if (t && !tt(t))
      for (const i in t)
        n[i] == null && Cc(r, i, "");
    for (const i in n)
      Cc(r, i, n[i]);
  } else {
    const i = r.display;
    o ? t !== n && (r.cssText = n) : t && e.removeAttribute("style"), Bu in e && (r.display = i);
  }
}
const h1 = /[^\\];\s*$/, Qd = /\s*!important$/;
function Cc(e, t, n) {
  if (ge(n))
    n.forEach((r) => Cc(e, t, r));
  else if (n == null && (n = ""), Vr.NODE_ENV !== "production" && h1.test(n) && Z(
    `Unexpected semicolon at the end of '${t}' style value: '${n}'`
  ), t.startsWith("--"))
    e.setProperty(t, n);
  else {
    const r = p1(e, t);
    Qd.test(n) ? e.setProperty(
      Qn(r),
      n.replace(Qd, ""),
      "important"
    ) : e[r] = n;
  }
}
const ef = ["Webkit", "Moz", "ms"], Al = {};
function p1(e, t) {
  const n = Al[t];
  if (n)
    return n;
  let r = Oo(t);
  if (r !== "filter" && r in e)
    return Al[t] = r;
  r = Ja(r);
  for (let o = 0; o < ef.length; o++) {
    const i = ef[o] + r;
    if (i in e)
      return Al[t] = i;
  }
  return t;
}
const tf = "http://www.w3.org/1999/xlink";
function m1(e, t, n, r, o) {
  if (r && t.startsWith("xlink:"))
    n == null ? e.removeAttributeNS(tf, t.slice(6, t.length)) : e.setAttributeNS(tf, t, n);
  else {
    const i = Hy(t);
    n == null || i && !yp(n) ? e.removeAttribute(t) : e.setAttribute(t, i ? "" : n);
  }
}
function g1(e, t, n, r, o, i, s) {
  if (t === "innerHTML" || t === "textContent") {
    r && s(r, o, i), e[t] = n ?? "";
    return;
  }
  const a = e.tagName;
  if (t === "value" && a !== "PROGRESS" && // custom elements may use _value internally
  !a.includes("-")) {
    e._value = n;
    const c = a === "OPTION" ? e.getAttribute("value") : e.value, u = n ?? "";
    c !== u && (e.value = u), n == null && e.removeAttribute(t);
    return;
  }
  let l = !1;
  if (n === "" || n == null) {
    const c = typeof e[t];
    c === "boolean" ? n = yp(n) : n == null && c === "string" ? (n = "", l = !0) : c === "number" && (n = 0, l = !0);
  }
  try {
    e[t] = n;
  } catch (c) {
    Vr.NODE_ENV !== "production" && !l && Z(
      `Failed setting prop "${t}" on <${a.toLowerCase()}>: value ${n} is invalid.`,
      c
    );
  }
  l && e.removeAttribute(t);
}
function v1(e, t, n, r) {
  e.addEventListener(t, n, r);
}
function y1(e, t, n, r) {
  e.removeEventListener(t, n, r);
}
const nf = Symbol("_vei");
function b1(e, t, n, r, o = null) {
  const i = e[nf] || (e[nf] = {}), s = i[t];
  if (r && s)
    s.value = r;
  else {
    const [a, l] = C1(t);
    if (r) {
      const c = i[t] = S1(r, o);
      v1(e, a, c, l);
    } else
      s && (y1(e, a, s, l), i[t] = void 0);
  }
}
const rf = /(?:Once|Passive|Capture)$/;
function C1(e) {
  let t;
  if (rf.test(e)) {
    t = {};
    let r;
    for (; r = e.match(rf); )
      e = e.slice(0, e.length - r[0].length), t[r[0].toLowerCase()] = !0;
  }
  return [e[2] === ":" ? e.slice(3) : Qn(e.slice(2)), t];
}
let Dl = 0;
const w1 = /* @__PURE__ */ Promise.resolve(), x1 = () => Dl || (w1.then(() => Dl = 0), Dl = Date.now());
function S1(e, t) {
  const n = (r) => {
    if (!r._vts)
      r._vts = Date.now();
    else if (r._vts <= n.attached)
      return;
    Kt(
      E1(r, n.value),
      t,
      5,
      [r]
    );
  };
  return n.value = e, n.attached = x1(), n;
}
function E1(e, t) {
  if (ge(t)) {
    const n = e.stopImmediatePropagation;
    return e.stopImmediatePropagation = () => {
      n.call(e), e._stopped = !0;
    }, t.map((r) => (o) => !o._stopped && r && r(o));
  } else
    return t;
}
const of = (e) => e.charCodeAt(0) === 111 && e.charCodeAt(1) === 110 && // lowercase letter
e.charCodeAt(2) > 96 && e.charCodeAt(2) < 123, _1 = (e, t, n, r, o = !1, i, s, a, l) => {
  t === "class" ? d1(e, r, o) : t === "style" ? f1(e, n, r) : ss(t) ? va(t) || b1(e, t, n, r, s) : (t[0] === "." ? (t = t.slice(1), !0) : t[0] === "^" ? (t = t.slice(1), !1) : I1(e, t, r, o)) ? g1(
    e,
    t,
    r,
    i,
    s,
    a,
    l
  ) : (t === "true-value" ? e._trueValue = r : t === "false-value" && (e._falseValue = r), m1(e, t, r, o));
};
function I1(e, t, n, r) {
  if (r)
    return !!(t === "innerHTML" || t === "textContent" || t in e && of(t) && be(n));
  if (t === "spellcheck" || t === "draggable" || t === "translate" || t === "form" || t === "list" && e.tagName === "INPUT" || t === "type" && e.tagName === "TEXTAREA")
    return !1;
  if (t === "width" || t === "height") {
    const o = e.tagName;
    if (o === "IMG" || o === "VIDEO" || o === "CANVAS" || o === "SOURCE")
      return !1;
  }
  return of(t) && tt(n) ? !1 : t in e;
}
const Am = /* @__PURE__ */ new WeakMap(), Dm = /* @__PURE__ */ new WeakMap(), Ta = Symbol("_moveCb"), sf = Symbol("_enterCb"), Mm = {
  name: "TransitionGroup",
  props: /* @__PURE__ */ Ze({}, l1, {
    tag: String,
    moveClass: String
  }),
  setup(e, { slots: t }) {
    const n = ll(), r = Jp();
    let o, i;
    return om(() => {
      if (!o.length)
        return;
      const s = e.moveClass || `${e.name || "v"}-move`;
      if (!M1(
        o[0].el,
        n.vnode.el,
        s
      ))
        return;
      o.forEach(O1), o.forEach(A1);
      const a = o.filter(D1);
      Om(), a.forEach((l) => {
        const c = l.el, u = c.style;
        Cn(c, s), u.transform = u.webkitTransform = u.transitionDuration = "";
        const d = c[Ta] = (f) => {
          f && f.target !== c || (!f || /transform$/.test(f.propertyName)) && (c.removeEventListener("transitionend", d), c[Ta] = null, Bn(c, s));
        };
        c.addEventListener("transitionend", d);
      });
    }), () => {
      const s = Se(e), a = Nm(s);
      let l = s.tag || dt;
      o = i, i = t.default ? Du(t.default()) : [];
      for (let c = 0; c < i.length; c++) {
        const u = i[c];
        u.key != null ? ji(
          u,
          zi(u, a, r, n)
        ) : Vr.NODE_ENV !== "production" && Z("<TransitionGroup> children must be keyed.");
      }
      if (o)
        for (let c = 0; c < o.length; c++) {
          const u = o[c];
          ji(
            u,
            zi(u, a, r, n)
          ), Am.set(u, u.el.getBoundingClientRect());
        }
      return Et(l, null, i);
    };
  }
}, N1 = (e) => delete e.mode;
Mm.props;
const T1 = Mm;
function O1(e) {
  const t = e.el;
  t[Ta] && t[Ta](), t[sf] && t[sf]();
}
function A1(e) {
  Dm.set(e, e.el.getBoundingClientRect());
}
function D1(e) {
  const t = Am.get(e), n = Dm.get(e), r = t.left - n.left, o = t.top - n.top;
  if (r || o) {
    const i = e.el.style;
    return i.transform = i.webkitTransform = `translate(${r}px,${o}px)`, i.transitionDuration = "0s", e;
  }
}
function M1(e, t, n) {
  const r = e.cloneNode(), o = e[Do];
  o && o.forEach((a) => {
    a.split(/\s+/).forEach((l) => l && r.classList.remove(l));
  }), n.split(/\s+/).forEach((a) => a && r.classList.add(a)), r.style.display = "none";
  const i = t.nodeType === 1 ? t : t.parentNode;
  i.appendChild(r);
  const { hasTransform: s } = Tm(r);
  return i.removeChild(r), s;
}
const $1 = /* @__PURE__ */ Ze({ patchProp: _1 }, a1);
let af;
function k1() {
  return af || (af = $0($1));
}
const R1 = (...e) => {
  const t = k1().createApp(...e);
  Vr.NODE_ENV !== "production" && (P1(t), F1(t));
  const { mount: n } = t;
  return t.mount = (r) => {
    const o = B1(r);
    if (!o)
      return;
    const i = t._component;
    !be(i) && !i.render && !i.template && (i.template = o.innerHTML), o.innerHTML = "";
    const s = n(o, !1, o instanceof SVGElement);
    return o instanceof Element && (o.removeAttribute("v-cloak"), o.setAttribute("data-v-app", "")), s;
  }, t;
};
function P1(e) {
  Object.defineProperty(e.config, "isNativeTag", {
    value: (t) => Vy(t) || zy(t),
    writable: !1
  });
}
function F1(e) {
  {
    const t = e.config.isCustomElement;
    Object.defineProperty(e.config, "isCustomElement", {
      get() {
        return t;
      },
      set() {
        Z(
          "The `isCustomElement` config option is deprecated. Use `compilerOptions.isCustomElement` instead."
        );
      }
    });
    const n = e.config.compilerOptions, r = 'The `compilerOptions` config option is only respected when using a build of Vue.js that includes the runtime compiler (aka "full build"). Since you are using the runtime-only build, `compilerOptions` must be passed to `@vue/compiler-dom` in the build setup instead.\n- For vue-loader: pass it via vue-loader\'s `compilerOptions` loader option.\n- For vue-cli: see https://cli.vuejs.org/guide/webpack.html#modifying-options-of-a-loader\n- For vite: pass it via @vitejs/plugin-vue options. See https://github.com/vitejs/vite-plugin-vue/tree/main/packages/plugin-vue#example-for-passing-options-to-vuecompiler-sfc';
    Object.defineProperty(e.config, "compilerOptions", {
      get() {
        return Z(r), n;
      },
      set() {
        Z(r);
      }
    });
  }
}
function B1(e) {
  if (tt(e)) {
    const t = document.querySelector(e);
    return Vr.NODE_ENV !== "production" && !t && Z(
      `Failed to mount app: mount target selector "${e}" returned null.`
    ), t;
  }
  return Vr.NODE_ENV !== "production" && window.ShadowRoot && e instanceof window.ShadowRoot && e.mode === "closed" && Z(
    'mounting on a ShadowRoot with `{mode: "closed"}` may lead to unpredictable bugs'
  ), e;
}
var L1 = {};
function V1() {
  i1();
}
L1.NODE_ENV !== "production" && V1();
function Lu(e) {
  return e.composedPath()[0] || null;
}
function $m(e, t) {
  const n = e.trim().split(/\s+/g), r = {
    top: n[0]
  };
  switch (n.length) {
    case 1:
      r.right = n[0], r.bottom = n[0], r.left = n[0];
      break;
    case 2:
      r.right = n[1], r.left = n[1], r.bottom = n[0];
      break;
    case 3:
      r.right = n[1], r.bottom = n[2], r.left = n[1];
      break;
    case 4:
      r.right = n[1], r.bottom = n[2], r.left = n[3];
      break;
    default:
      throw new Error("[seemly/getMargin]:" + e + " is not a valid value.");
  }
  return t === void 0 ? r : r[t];
}
const lf = {
  black: "#000",
  silver: "#C0C0C0",
  gray: "#808080",
  white: "#FFF",
  maroon: "#800000",
  red: "#F00",
  purple: "#800080",
  fuchsia: "#F0F",
  green: "#008000",
  lime: "#0F0",
  olive: "#808000",
  yellow: "#FF0",
  navy: "#000080",
  blue: "#00F",
  teal: "#008080",
  aqua: "#0FF",
  transparent: "#0000"
}, Bo = "^\\s*", Lo = "\\s*$", Cr = "\\s*((\\.\\d+)|(\\d+(\\.\\d*)?))\\s*", wr = "([0-9A-Fa-f])", xr = "([0-9A-Fa-f]{2})", z1 = new RegExp(`${Bo}rgb\\s*\\(${Cr},${Cr},${Cr}\\)${Lo}`), j1 = new RegExp(`${Bo}rgba\\s*\\(${Cr},${Cr},${Cr},${Cr}\\)${Lo}`), H1 = new RegExp(`${Bo}#${wr}${wr}${wr}${Lo}`), W1 = new RegExp(`${Bo}#${xr}${xr}${xr}${Lo}`), U1 = new RegExp(`${Bo}#${wr}${wr}${wr}${wr}${Lo}`), K1 = new RegExp(`${Bo}#${xr}${xr}${xr}${xr}${Lo}`);
function Pt(e) {
  return parseInt(e, 16);
}
function zr(e) {
  try {
    let t;
    if (t = W1.exec(e))
      return [Pt(t[1]), Pt(t[2]), Pt(t[3]), 1];
    if (t = z1.exec(e))
      return [wt(t[1]), wt(t[5]), wt(t[9]), 1];
    if (t = j1.exec(e))
      return [
        wt(t[1]),
        wt(t[5]),
        wt(t[9]),
        wi(t[13])
      ];
    if (t = H1.exec(e))
      return [
        Pt(t[1] + t[1]),
        Pt(t[2] + t[2]),
        Pt(t[3] + t[3]),
        1
      ];
    if (t = K1.exec(e))
      return [
        Pt(t[1]),
        Pt(t[2]),
        Pt(t[3]),
        wi(Pt(t[4]) / 255)
      ];
    if (t = U1.exec(e))
      return [
        Pt(t[1] + t[1]),
        Pt(t[2] + t[2]),
        Pt(t[3] + t[3]),
        wi(Pt(t[4] + t[4]) / 255)
      ];
    if (e in lf)
      return zr(lf[e]);
    throw new Error(`[seemly/rgba]: Invalid color value ${e}.`);
  } catch (t) {
    throw t;
  }
}
function G1(e) {
  return e > 1 ? 1 : e < 0 ? 0 : e;
}
function wc(e, t, n, r) {
  return `rgba(${wt(e)}, ${wt(t)}, ${wt(n)}, ${G1(r)})`;
}
function Ml(e, t, n, r, o) {
  return wt((e * t * (1 - r) + n * r) / o);
}
function Vu(e, t) {
  Array.isArray(e) || (e = zr(e)), Array.isArray(t) || (t = zr(t));
  const n = e[3], r = t[3], o = wi(n + r - n * r);
  return wc(Ml(e[0], n, t[0], r, o), Ml(e[1], n, t[1], r, o), Ml(e[2], n, t[2], r, o), o);
}
function Ms(e, t) {
  const [n, r, o, i = 1] = Array.isArray(e) ? e : zr(e);
  return t.alpha ? wc(n, r, o, t.alpha) : wc(n, r, o, i);
}
function $s(e, t) {
  const [n, r, o, i = 1] = Array.isArray(e) ? e : zr(e), { lightness: s = 1, alpha: a = 1 } = t;
  return Y1([n * s, r * s, o * s, i * a]);
}
function wi(e) {
  const t = Math.round(Number(e) * 100) / 100;
  return t > 1 ? 1 : t < 0 ? 0 : t;
}
function wt(e) {
  const t = Math.round(Number(e));
  return t > 255 ? 255 : t < 0 ? 0 : t;
}
function Y1(e) {
  const [t, n, r] = e;
  return 3 in e ? `rgba(${wt(t)}, ${wt(n)}, ${wt(r)}, ${wi(e[3])})` : `rgba(${wt(t)}, ${wt(n)}, ${wt(r)}, 1)`;
}
function q1(e = 8) {
  return Math.random().toString(16).slice(2, 2 + e);
}
function xc(e, t = [], n) {
  const r = {};
  return t.forEach((o) => {
    r[o] = e[o];
  }), Object.assign(r, n);
}
function Sc(e, t = !0, n = []) {
  return e.forEach((r) => {
    if (r !== null) {
      if (typeof r != "object") {
        (typeof r == "string" || typeof r == "number") && n.push(Na(String(r)));
        return;
      }
      if (Array.isArray(r)) {
        Sc(r, t, n);
        return;
      }
      if (r.type === dt) {
        if (r.children === null)
          return;
        Array.isArray(r.children) && Sc(r.children, t, n);
      } else {
        if (r.type === gt && t)
          return;
        n.push(r);
      }
    }
  }), n;
}
function Sr(e, ...t) {
  if (Array.isArray(e))
    e.forEach((n) => Sr(n, ...t));
  else
    return e(...t);
}
function zu(e) {
  return Object.keys(e);
}
const Jr = (e, ...t) => typeof e == "function" ? e(...t) : typeof e == "string" ? Na(e) : typeof e == "number" ? Na(String(e)) : null, cf = /* @__PURE__ */ new Set();
function di(e, t) {
  const n = `[naive/${e}]: ${t}`;
  cf.has(n) || (cf.add(n), console.error(n));
}
function Ec(e, t) {
  console.error(`[naive/${e}]: ${t}`);
}
function km(e, t) {
  throw new Error(`[naive/${e}]: ${t}`);
}
function Z1(e, t = "default", n = void 0) {
  const r = e[t];
  if (!r)
    return Ec("getFirstSlotVNode", `slot[${t}] is empty`), null;
  const o = Sc(r(n));
  return o.length === 1 ? o[0] : (Ec("getFirstSlotVNode", `slot[${t}] should have exactly one child`), null);
}
function dl(e) {
  return e.some((t) => Lr(t) ? !(t.type === gt || t.type === dt && !dl(t.children)) : !0) ? e : null;
}
function uf(e, t) {
  return e && dl(e()) || t();
}
function Xt(e, t) {
  const n = e && dl(e());
  return t(n || null);
}
function X1(e) {
  return !(e && dl(e()));
}
const df = /* @__PURE__ */ bt({
  render() {
    var e, t;
    return (t = (e = this.$slots).default) === null || t === void 0 ? void 0 : t.call(e);
  }
});
function ff(e) {
  return e.replace(/#|\(|\)|,|\s|\./g, "_");
}
function J1(e) {
  let t = 0;
  for (let n = 0; n < e.length; ++n)
    e[n] === "&" && ++t;
  return t;
}
const Rm = /\s*,(?![^(]*\))\s*/g, Q1 = /\s+/g;
function eC(e, t) {
  const n = [];
  return t.split(Rm).forEach((r) => {
    let o = J1(r);
    if (o) {
      if (o === 1) {
        e.forEach((s) => {
          n.push(r.replace("&", s));
        });
        return;
      }
    } else {
      e.forEach((s) => {
        n.push(
          // eslint-disable-next-line @typescript-eslint/strict-boolean-expressions
          (s && s + " ") + r
        );
      });
      return;
    }
    let i = [
      r
    ];
    for (; o--; ) {
      const s = [];
      i.forEach((a) => {
        e.forEach((l) => {
          s.push(a.replace("&", l));
        });
      }), i = s;
    }
    i.forEach((s) => n.push(s));
  }), n;
}
function tC(e, t) {
  const n = [];
  return t.split(Rm).forEach((r) => {
    e.forEach((o) => {
      n.push((o && o + " ") + r);
    });
  }), n;
}
function nC(e) {
  let t = [""];
  return e.forEach((n) => {
    n = n && n.trim(), // eslint-disable-next-line @typescript-eslint/strict-boolean-expressions
    n && (n.includes("&") ? t = eC(t, n) : t = tC(t, n));
  }), t.join(", ").replace(Q1, " ");
}
function hf(e) {
  if (!e)
    return;
  const t = e.parentElement;
  t && t.removeChild(e);
}
function fl(e) {
  return document.querySelector(`style[cssr-id="${e}"]`);
}
function rC(e) {
  const t = document.createElement("style");
  return t.setAttribute("cssr-id", e), t;
}
function ks(e) {
  return e ? /^\s*@(s|m)/.test(e) : !1;
}
const oC = /[A-Z]/g;
function Pm(e) {
  return e.replace(oC, (t) => "-" + t.toLowerCase());
}
function iC(e, t = "  ") {
  return typeof e == "object" && e !== null ? ` {
` + Object.entries(e).map((n) => t + `  ${Pm(n[0])}: ${n[1]};`).join(`
`) + `
` + t + "}" : `: ${e};`;
}
function sC(e, t, n) {
  return typeof e == "function" ? e({
    context: t.context,
    props: n
  }) : e;
}
function pf(e, t, n, r) {
  if (!t)
    return "";
  const o = sC(t, n, r);
  if (!o)
    return "";
  if (typeof o == "string")
    return `${e} {
${o}
}`;
  const i = Object.keys(o);
  if (i.length === 0)
    return n.config.keepEmptyBlock ? e + ` {
}` : "";
  const s = e ? [
    e + " {"
  ] : [];
  return i.forEach((a) => {
    const l = o[a];
    if (a === "raw") {
      s.push(`
` + l + `
`);
      return;
    }
    a = Pm(a), l != null && s.push(`  ${a}${iC(l)}`);
  }), e && s.push("}"), s.join(`
`);
}
function _c(e, t, n) {
  e && e.forEach((r) => {
    if (Array.isArray(r))
      _c(r, t, n);
    else if (typeof r == "function") {
      const o = r(t);
      Array.isArray(o) ? _c(o, t, n) : o && n(o);
    } else
      r && n(r);
  });
}
function Fm(e, t, n, r, o, i) {
  const s = e.$;
  let a = "";
  if (!s || typeof s == "string")
    ks(s) ? a = s : t.push(s);
  else if (typeof s == "function") {
    const u = s({
      context: r.context,
      props: o
    });
    ks(u) ? a = u : t.push(u);
  } else if (s.before && s.before(r.context), !s.$ || typeof s.$ == "string")
    ks(s.$) ? a = s.$ : t.push(s.$);
  else if (s.$) {
    const u = s.$({
      context: r.context,
      props: o
    });
    ks(u) ? a = u : t.push(u);
  }
  const l = nC(t), c = pf(l, e.props, r, o);
  a ? (n.push(`${a} {`), i && c && i.insertRule(`${a} {
${c}
}
`)) : (i && c && i.insertRule(c), !i && c.length && n.push(c)), e.children && _c(e.children, {
    context: r.context,
    props: o
  }, (u) => {
    if (typeof u == "string") {
      const d = pf(l, { raw: u }, r, o);
      i ? i.insertRule(d) : n.push(d);
    } else
      Fm(u, t, n, r, o, i);
  }), t.pop(), a && n.push("}"), s && s.after && s.after(r.context);
}
function Bm(e, t, n, r = !1) {
  const o = [];
  return Fm(e, [], o, t, n, r ? e.instance.__styleSheet : void 0), r ? "" : o.join(`

`);
}
function Ic(e) {
  for (var t = 0, n, r = 0, o = e.length; o >= 4; ++r, o -= 4)
    n = e.charCodeAt(r) & 255 | (e.charCodeAt(++r) & 255) << 8 | (e.charCodeAt(++r) & 255) << 16 | (e.charCodeAt(++r) & 255) << 24, n = /* Math.imul(k, m): */
    (n & 65535) * 1540483477 + ((n >>> 16) * 59797 << 16), n ^= /* k >>> r: */
    n >>> 24, t = /* Math.imul(k, m): */
    (n & 65535) * 1540483477 + ((n >>> 16) * 59797 << 16) ^ /* Math.imul(h, m): */
    (t & 65535) * 1540483477 + ((t >>> 16) * 59797 << 16);
  switch (o) {
    case 3:
      t ^= (e.charCodeAt(r + 2) & 255) << 16;
    case 2:
      t ^= (e.charCodeAt(r + 1) & 255) << 8;
    case 1:
      t ^= e.charCodeAt(r) & 255, t = /* Math.imul(h, m): */
      (t & 65535) * 1540483477 + ((t >>> 16) * 59797 << 16);
  }
  return t ^= t >>> 13, t = /* Math.imul(h, m): */
  (t & 65535) * 1540483477 + ((t >>> 16) * 59797 << 16), ((t ^ t >>> 15) >>> 0).toString(36);
}
typeof window < "u" && (window.__cssrContext = {});
function aC(e, t, n) {
  const { els: r } = t;
  if (n === void 0)
    r.forEach(hf), t.els = [];
  else {
    const o = fl(n);
    o && r.includes(o) && (hf(o), t.els = r.filter((i) => i !== o));
  }
}
function mf(e, t) {
  e.push(t);
}
function lC(e, t, n, r, o, i, s, a, l) {
  if (i && !l) {
    if (n === void 0) {
      console.error("[css-render/mount]: `id` is required in `silent` mode.");
      return;
    }
    const f = window.__cssrContext;
    f[n] || (f[n] = !0, Bm(t, e, r, i));
    return;
  }
  let c;
  if (n === void 0 && (c = t.render(r), n = Ic(c)), l) {
    l.adapter(n, c ?? t.render(r));
    return;
  }
  const u = fl(n);
  if (u !== null && !s)
    return u;
  const d = u ?? rC(n);
  if (c === void 0 && (c = t.render(r)), d.textContent = c, u !== null)
    return u;
  if (a) {
    const f = document.head.querySelector(`meta[name="${a}"]`);
    if (f)
      return document.head.insertBefore(d, f), mf(t.els, d), d;
  }
  return o ? document.head.insertBefore(d, document.head.querySelector("style, link")) : document.head.appendChild(d), mf(t.els, d), d;
}
function cC(e) {
  return Bm(this, this.instance, e);
}
function uC(e = {}) {
  const { id: t, ssr: n, props: r, head: o = !1, silent: i = !1, force: s = !1, anchorMetaName: a } = e;
  return lC(this.instance, this, t, r, o, i, s, a, n);
}
function dC(e = {}) {
  const { id: t } = e;
  aC(this.instance, this, t);
}
const Rs = function(e, t, n, r) {
  return {
    instance: e,
    $: t,
    props: n,
    children: r,
    els: [],
    render: cC,
    mount: uC,
    unmount: dC
  };
}, fC = function(e, t, n, r) {
  return Array.isArray(t) ? Rs(e, { $: null }, null, t) : Array.isArray(n) ? Rs(e, t, null, n) : Array.isArray(r) ? Rs(e, t, n, r) : Rs(e, t, n, null);
};
function hC(e = {}) {
  let t = null;
  const n = {
    c: (...r) => fC(n, ...r),
    use: (r, ...o) => r.install(n, ...o),
    find: fl,
    context: {},
    config: e,
    get __styleSheet() {
      if (!t) {
        const r = document.createElement("style");
        return document.head.appendChild(r), t = document.styleSheets[document.styleSheets.length - 1], t;
      }
      return t;
    }
  };
  return n;
}
function pC(e, t) {
  if (e === void 0)
    return !1;
  if (t) {
    const { context: { ids: n } } = t;
    return n.has(e);
  }
  return fl(e) !== null;
}
var gf = {};
function mC(e) {
  let t = ".", n = "__", r = "--", o;
  if (e) {
    let h = e.blockPrefix;
    h && (t = h), h = e.elementPrefix, h && (n = h), h = e.modifierPrefix, h && (r = h);
  }
  const i = {
    install(h) {
      o = h.c;
      const p = h.context;
      p.bem = {}, p.bem.b = null, p.bem.els = null;
    }
  };
  function s(h) {
    let p, g;
    return {
      before(v) {
        p = v.bem.b, g = v.bem.els, v.bem.els = null;
      },
      after(v) {
        v.bem.b = p, v.bem.els = g;
      },
      $({ context: v, props: y }) {
        return h = typeof h == "string" ? h : h({ context: v, props: y }), v.bem.b = h, `${(y == null ? void 0 : y.bPrefix) || t}${v.bem.b}`;
      }
    };
  }
  function a(h) {
    let p;
    return {
      before(g) {
        p = g.bem.els;
      },
      after(g) {
        g.bem.els = p;
      },
      $({ context: g, props: v }) {
        return h = typeof h == "string" ? h : h({ context: g, props: v }), g.bem.els = h.split(",").map((y) => y.trim()), g.bem.els.map((y) => `${(v == null ? void 0 : v.bPrefix) || t}${g.bem.b}${n}${y}`).join(", ");
      }
    };
  }
  function l(h) {
    return {
      $({ context: p, props: g }) {
        h = typeof h == "string" ? h : h({ context: p, props: g });
        const v = h.split(",").map((E) => E.trim());
        function y(E) {
          return v.map((S) => `&${(g == null ? void 0 : g.bPrefix) || t}${p.bem.b}${E !== void 0 ? `${n}${E}` : ""}${r}${S}`).join(", ");
        }
        const b = p.bem.els;
        if (b !== null) {
          if (gf.NODE_ENV !== "production" && b.length >= 2)
            throw Error(`[css-render/plugin-bem]: m(${h}) is invalid, using modifier inside multiple elements is not allowed`);
          return y(b[0]);
        } else
          return y();
      }
    };
  }
  function c(h) {
    return {
      $({ context: p, props: g }) {
        h = typeof h == "string" ? h : h({ context: p, props: g });
        const v = p.bem.els;
        if (gf.NODE_ENV !== "production" && v !== null && v.length >= 2)
          throw Error(`[css-render/plugin-bem]: notM(${h}) is invalid, using modifier inside multiple elements is not allowed`);
        return `&:not(${(g == null ? void 0 : g.bPrefix) || t}${p.bem.b}${v !== null && v.length > 0 ? `${n}${v[0]}` : ""}${r}${h})`;
      }
    };
  }
  return Object.assign(i, {
    cB: (...h) => o(s(h[0]), h[1], h[2]),
    cE: (...h) => o(a(h[0]), h[1], h[2]),
    cM: (...h) => o(l(h[0]), h[1], h[2]),
    cNotM: (...h) => o(c(h[0]), h[1], h[2])
  }), i;
}
const gC = "n", Ui = `.${gC}-`, vC = "__", yC = "--", Lm = hC(), Vm = mC({
  blockPrefix: Ui,
  elementPrefix: vC,
  modifierPrefix: yC
});
Lm.use(Vm);
const {
  c: oe,
  find: qT
} = Lm, {
  cB: Ye,
  cE: fe,
  cM: Me,
  cNotM: Nc
} = Vm;
function zm(e) {
  return oe(({
    props: {
      bPrefix: t
    }
  }) => `${t || Ui}modal, ${t || Ui}drawer`, [e]);
}
function bC(e) {
  return oe(({
    props: {
      bPrefix: t
    }
  }) => `${t || Ui}popover`, [e]);
}
function jm(e) {
  return oe(({
    props: {
      bPrefix: t
    }
  }) => `&${t || Ui}modal`, e);
}
function _e(e, t) {
  return e + (t === "default" ? "" : t.replace(/^[a-z]/, (n) => n.toUpperCase()));
}
const us = typeof document < "u" && typeof window < "u", CC = /* @__PURE__ */ new WeakSet();
function wC(e) {
  return !CC.has(e);
}
function xC(e) {
  const t = Ee(!!e.value);
  if (t.value)
    return On(t);
  const n = _n(e, (r) => {
    r && (t.value = !0, n());
  });
  return On(t);
}
function SC(e) {
  const t = Te(e), n = Ee(t.value);
  return _n(t, (r) => {
    n.value = r;
  }), typeof e == "function" ? n : {
    __v_isRef: !0,
    get value() {
      return n.value;
    },
    set value(r) {
      e.set(r);
    }
  };
}
function Hm() {
  return ll() !== null;
}
const Wm = typeof window < "u";
function ia(e) {
  return e.composedPath()[0];
}
const EC = {
  mousemoveoutside: /* @__PURE__ */ new WeakMap(),
  clickoutside: /* @__PURE__ */ new WeakMap()
};
function _C(e, t, n) {
  if (e === "mousemoveoutside") {
    const r = (o) => {
      t.contains(ia(o)) || n(o);
    };
    return {
      mousemove: r,
      touchstart: r
    };
  } else if (e === "clickoutside") {
    let r = !1;
    const o = (s) => {
      r = !t.contains(ia(s));
    }, i = (s) => {
      r && (t.contains(ia(s)) || n(s));
    };
    return {
      mousedown: o,
      mouseup: i,
      touchstart: o,
      touchend: i
    };
  }
  return console.error(
    // eslint-disable-next-line @typescript-eslint/restrict-template-expressions
    `[evtd/create-trap-handler]: name \`${e}\` is invalid. This could be a bug of evtd.`
  ), {};
}
function Um(e, t, n) {
  const r = EC[e];
  let o = r.get(t);
  o === void 0 && r.set(t, o = /* @__PURE__ */ new WeakMap());
  let i = o.get(n);
  return i === void 0 && o.set(n, i = _C(e, t, n)), i;
}
function IC(e, t, n, r) {
  if (e === "mousemoveoutside" || e === "clickoutside") {
    const o = Um(e, t, n);
    return Object.keys(o).forEach((i) => {
      Wt(i, document, o[i], r);
    }), !0;
  }
  return !1;
}
function NC(e, t, n, r) {
  if (e === "mousemoveoutside" || e === "clickoutside") {
    const o = Um(e, t, n);
    return Object.keys(o).forEach((i) => {
      Ot(i, document, o[i], r);
    }), !0;
  }
  return !1;
}
function TC() {
  if (typeof window > "u")
    return {
      on: () => {
      },
      off: () => {
      }
    };
  const e = /* @__PURE__ */ new WeakMap(), t = /* @__PURE__ */ new WeakMap();
  function n() {
    e.set(this, !0);
  }
  function r() {
    e.set(this, !0), t.set(this, !0);
  }
  function o(C, _, w) {
    const R = C[_];
    return C[_] = function() {
      return w.apply(C, arguments), R.apply(C, arguments);
    }, C;
  }
  function i(C, _) {
    C[_] = Event.prototype[_];
  }
  const s = /* @__PURE__ */ new WeakMap(), a = Object.getOwnPropertyDescriptor(Event.prototype, "currentTarget");
  function l() {
    var C;
    return (C = s.get(this)) !== null && C !== void 0 ? C : null;
  }
  function c(C, _) {
    a !== void 0 && Object.defineProperty(C, "currentTarget", {
      configurable: !0,
      enumerable: !0,
      get: _ ?? a.get
    });
  }
  const u = {
    bubble: {},
    capture: {}
  }, d = {};
  function f() {
    const C = function(_) {
      const { type: w, eventPhase: R, bubbles: O } = _, I = ia(_);
      if (R === 2)
        return;
      const L = R === 1 ? "capture" : "bubble";
      let D = I;
      const P = [];
      for (; D === null && (D = window), P.push(D), D !== window; )
        D = D.parentNode || null;
      const k = u.capture[w], N = u.bubble[w];
      if (o(_, "stopPropagation", n), o(_, "stopImmediatePropagation", r), c(_, l), L === "capture") {
        if (k === void 0)
          return;
        for (let $ = P.length - 1; $ >= 0 && !e.has(_); --$) {
          const B = P[$], U = k.get(B);
          if (U !== void 0) {
            s.set(_, B);
            for (const J of U) {
              if (t.has(_))
                break;
              J(_);
            }
          }
          if ($ === 0 && !O && N !== void 0) {
            const J = N.get(B);
            if (J !== void 0)
              for (const te of J) {
                if (t.has(_))
                  break;
                te(_);
              }
          }
        }
      } else if (L === "bubble") {
        if (N === void 0)
          return;
        for (let $ = 0; $ < P.length && !e.has(_); ++$) {
          const B = P[$], U = N.get(B);
          if (U !== void 0) {
            s.set(_, B);
            for (const J of U) {
              if (t.has(_))
                break;
              J(_);
            }
          }
        }
      }
      i(_, "stopPropagation"), i(_, "stopImmediatePropagation"), c(_);
    };
    return C.displayName = "evtdUnifiedHandler", C;
  }
  function m() {
    const C = function(_) {
      const { type: w, eventPhase: R } = _;
      if (R !== 2)
        return;
      const O = d[w];
      O !== void 0 && O.forEach((I) => I(_));
    };
    return C.displayName = "evtdUnifiedWindowEventHandler", C;
  }
  const h = f(), p = m();
  function g(C, _) {
    const w = u[C];
    return w[_] === void 0 && (w[_] = /* @__PURE__ */ new Map(), window.addEventListener(_, h, C === "capture")), w[_];
  }
  function v(C) {
    return d[C] === void 0 && (d[C] = /* @__PURE__ */ new Set(), window.addEventListener(C, p)), d[C];
  }
  function y(C, _) {
    let w = C.get(_);
    return w === void 0 && C.set(_, w = /* @__PURE__ */ new Set()), w;
  }
  function b(C, _, w, R) {
    const O = u[_][w];
    if (O !== void 0) {
      const I = O.get(C);
      if (I !== void 0 && I.has(R))
        return !0;
    }
    return !1;
  }
  function E(C, _) {
    const w = d[C];
    return !!(w !== void 0 && w.has(_));
  }
  function S(C, _, w, R) {
    let O;
    if (typeof R == "object" && R.once === !0 ? O = (k) => {
      T(C, _, O, R), w(k);
    } : O = w, IC(C, _, O, R))
      return;
    const L = R === !0 || typeof R == "object" && R.capture === !0 ? "capture" : "bubble", D = g(L, C), P = y(D, _);
    if (P.has(O) || P.add(O), _ === window) {
      const k = v(C);
      k.has(O) || k.add(O);
    }
  }
  function T(C, _, w, R) {
    if (NC(C, _, w, R))
      return;
    const I = R === !0 || typeof R == "object" && R.capture === !0, L = I ? "capture" : "bubble", D = g(L, C), P = y(D, _);
    if (_ === window && !b(_, I ? "bubble" : "capture", C, w) && E(C, w)) {
      const N = d[C];
      N.delete(w), N.size === 0 && (window.removeEventListener(C, p), d[C] = void 0);
    }
    P.has(w) && P.delete(w), P.size === 0 && D.delete(_), D.size === 0 && (window.removeEventListener(C, h, L === "capture"), u[L][C] = void 0);
  }
  return {
    on: S,
    off: T
  };
}
const { on: Wt, off: Ot } = TC(), fi = Ee(null);
function vf(e) {
  if (e.clientX > 0 || e.clientY > 0)
    fi.value = {
      x: e.clientX,
      y: e.clientY
    };
  else {
    const { target: t } = e;
    if (t instanceof Element) {
      const { left: n, top: r, width: o, height: i } = t.getBoundingClientRect();
      n > 0 || r > 0 ? fi.value = {
        x: n + o / 2,
        y: r + i / 2
      } : fi.value = { x: 0, y: 0 };
    } else
      fi.value = null;
  }
}
let Ps = 0, yf = !0;
function OC() {
  if (!Wm)
    return On(Ee(null));
  Ps === 0 && Wt("click", document, vf, !0);
  const e = () => {
    Ps += 1;
  };
  return yf && (yf = Hm()) ? (Yr(e), nn(() => {
    Ps -= 1, Ps === 0 && Ot("click", document, vf, !0);
  })) : e(), On(fi);
}
const AC = Ee(void 0);
let Fs = 0;
function bf() {
  AC.value = Date.now();
}
let Cf = !0;
function DC(e) {
  if (!Wm)
    return On(Ee(!1));
  const t = Ee(!1);
  let n = null;
  function r() {
    n !== null && window.clearTimeout(n);
  }
  function o() {
    r(), t.value = !0, n = window.setTimeout(() => {
      t.value = !1;
    }, e);
  }
  Fs === 0 && Wt("click", window, bf, !0);
  const i = () => {
    Fs += 1, Wt("click", window, o, !0);
  };
  return Cf && (Cf = Hm()) ? (Yr(i), nn(() => {
    Fs -= 1, Fs === 0 && Ot("click", window, bf, !0), Ot("click", window, o, !0), r();
  })) : i(), On(t);
}
function Km() {
  const e = Ee(!1);
  return lr(() => {
    e.value = !0;
  }), On(e);
}
const MC = (typeof window > "u" ? !1 : /iPad|iPhone|iPod/.test(navigator.platform) || navigator.platform === "MacIntel" && navigator.maxTouchPoints > 1) && // eslint-disable-next-line @typescript-eslint/strict-boolean-expressions
!window.MSStream;
function $C() {
  return MC;
}
const kC = "n-modal-body", Gm = "n-modal", RC = "n-drawer-body", PC = "n-popover-body";
function wf(e, t, n = "default") {
  const r = t[n];
  if (r === void 0)
    throw new Error(`[vueuc/${e}]: slot[${n}] is empty.`);
  return r();
}
const Qr = "@@coContext", FC = {
  mounted(e, { value: t, modifiers: n }) {
    e[Qr] = {
      handler: void 0
    }, typeof t == "function" && (e[Qr].handler = t, Wt("clickoutside", e, t, {
      capture: n.capture
    }));
  },
  updated(e, { value: t, modifiers: n }) {
    const r = e[Qr];
    typeof t == "function" ? r.handler ? r.handler !== t && (Ot("clickoutside", e, r.handler, {
      capture: n.capture
    }), r.handler = t, Wt("clickoutside", e, t, {
      capture: n.capture
    })) : (e[Qr].handler = t, Wt("clickoutside", e, t, {
      capture: n.capture
    })) : r.handler && (Ot("clickoutside", e, r.handler, {
      capture: n.capture
    }), r.handler = void 0);
  },
  unmounted(e, { modifiers: t }) {
    const { handler: n } = e[Qr];
    n && Ot("clickoutside", e, n, {
      capture: t.capture
    }), e[Qr].handler = void 0;
  }
}, BC = FC;
function LC(e, t) {
  console.error(`[vdirs/${e}]: ${t}`);
}
class VC {
  constructor() {
    this.elementZIndex = /* @__PURE__ */ new Map(), this.nextZIndex = 2e3;
  }
  get elementCount() {
    return this.elementZIndex.size;
  }
  ensureZIndex(t, n) {
    const { elementZIndex: r } = this;
    if (n !== void 0) {
      t.style.zIndex = `${n}`, r.delete(t);
      return;
    }
    const { nextZIndex: o } = this;
    r.has(t) && r.get(t) + 1 === this.nextZIndex || (t.style.zIndex = `${o}`, r.set(t, o), this.nextZIndex = o + 1, this.squashState());
  }
  unregister(t, n) {
    const { elementZIndex: r } = this;
    r.has(t) ? r.delete(t) : n === void 0 && LC("z-index-manager/unregister-element", "Element not found when unregistering."), this.squashState();
  }
  squashState() {
    const { elementCount: t } = this;
    t || (this.nextZIndex = 2e3), this.nextZIndex - t > 2500 && this.rearrange();
  }
  rearrange() {
    const t = Array.from(this.elementZIndex.entries());
    t.sort((n, r) => n[1] - r[1]), this.nextZIndex = 2e3, t.forEach((n) => {
      const r = n[0], o = this.nextZIndex++;
      `${o}` !== r.style.zIndex && (r.style.zIndex = `${o}`);
    });
  }
}
const $l = new VC(), eo = "@@ziContext", zC = {
  mounted(e, t) {
    const { value: n = {} } = t, { zIndex: r, enabled: o } = n;
    e[eo] = {
      enabled: !!o,
      initialized: !1
    }, o && ($l.ensureZIndex(e, r), e[eo].initialized = !0);
  },
  updated(e, t) {
    const { value: n = {} } = t, { zIndex: r, enabled: o } = n, i = e[eo].enabled;
    o && !i && ($l.ensureZIndex(e, r), e[eo].initialized = !0), e[eo].enabled = !!o;
  },
  unmounted(e, t) {
    if (!e[eo].initialized)
      return;
    const { value: n = {} } = t, { zIndex: r } = n;
    $l.unregister(e, r);
  }
}, jC = zC, Ym = Symbol("@css-render/vue3-ssr");
function HC(e, t) {
  return `<style cssr-id="${e}">
${t}
</style>`;
}
function WC(e, t) {
  const n = $t(Ym, null);
  if (n === null) {
    console.error("[css-render/vue3-ssr]: no ssr context found.");
    return;
  }
  const { styles: r, ids: o } = n;
  o.has(e) || r !== null && (o.add(e), r.push(HC(e, t)));
}
const UC = typeof document < "u";
function hl() {
  if (UC)
    return;
  const e = $t(Ym, null);
  if (e !== null)
    return {
      adapter: WC,
      context: e
    };
}
function xf(e, t) {
  console.error(`[vueuc/${e}]: ${t}`);
}
function Sf(e) {
  return typeof e == "string" ? document.querySelector(e) : e();
}
const KC = /* @__PURE__ */ bt({
  name: "LazyTeleport",
  props: {
    to: {
      type: [String, Object],
      default: void 0
    },
    disabled: Boolean,
    show: {
      type: Boolean,
      required: !0
    }
  },
  setup(e) {
    return {
      showTeleport: xC(nr(e, "show")),
      mergedTo: Te(() => {
        const { to: t } = e;
        return t ?? "body";
      })
    };
  },
  render() {
    return this.showTeleport ? this.disabled ? wf("lazy-teleport", this.$slots) : q(V0, {
      disabled: this.disabled,
      to: this.mergedTo
    }, wf("lazy-teleport", this.$slots)) : null;
  }
});
var Mr = [], GC = function() {
  return Mr.some(function(e) {
    return e.activeTargets.length > 0;
  });
}, YC = function() {
  return Mr.some(function(e) {
    return e.skippedTargets.length > 0;
  });
}, Ef = "ResizeObserver loop completed with undelivered notifications.", qC = function() {
  var e;
  typeof ErrorEvent == "function" ? e = new ErrorEvent("error", {
    message: Ef
  }) : (e = document.createEvent("Event"), e.initEvent("error", !1, !1), e.message = Ef), window.dispatchEvent(e);
}, Ki;
(function(e) {
  e.BORDER_BOX = "border-box", e.CONTENT_BOX = "content-box", e.DEVICE_PIXEL_CONTENT_BOX = "device-pixel-content-box";
})(Ki || (Ki = {}));
var $r = function(e) {
  return Object.freeze(e);
}, ZC = /* @__PURE__ */ function() {
  function e(t, n) {
    this.inlineSize = t, this.blockSize = n, $r(this);
  }
  return e;
}(), qm = function() {
  function e(t, n, r, o) {
    return this.x = t, this.y = n, this.width = r, this.height = o, this.top = this.y, this.left = this.x, this.bottom = this.top + this.height, this.right = this.left + this.width, $r(this);
  }
  return e.prototype.toJSON = function() {
    var t = this, n = t.x, r = t.y, o = t.top, i = t.right, s = t.bottom, a = t.left, l = t.width, c = t.height;
    return { x: n, y: r, top: o, right: i, bottom: s, left: a, width: l, height: c };
  }, e.fromRect = function(t) {
    return new e(t.x, t.y, t.width, t.height);
  }, e;
}(), ju = function(e) {
  return e instanceof SVGElement && "getBBox" in e;
}, Zm = function(e) {
  if (ju(e)) {
    var t = e.getBBox(), n = t.width, r = t.height;
    return !n && !r;
  }
  var o = e, i = o.offsetWidth, s = o.offsetHeight;
  return !(i || s || e.getClientRects().length);
}, _f = function(e) {
  var t;
  if (e instanceof Element)
    return !0;
  var n = (t = e == null ? void 0 : e.ownerDocument) === null || t === void 0 ? void 0 : t.defaultView;
  return !!(n && e instanceof n.Element);
}, XC = function(e) {
  switch (e.tagName) {
    case "INPUT":
      if (e.type !== "image")
        break;
    case "VIDEO":
    case "AUDIO":
    case "EMBED":
    case "OBJECT":
    case "CANVAS":
    case "IFRAME":
    case "IMG":
      return !0;
  }
  return !1;
}, xi = typeof window < "u" ? window : {}, Bs = /* @__PURE__ */ new WeakMap(), If = /auto|scroll/, JC = /^tb|vertical/, QC = /msie|trident/i.test(xi.navigator && xi.navigator.userAgent), on = function(e) {
  return parseFloat(e || "0");
}, Eo = function(e, t, n) {
  return e === void 0 && (e = 0), t === void 0 && (t = 0), n === void 0 && (n = !1), new ZC((n ? t : e) || 0, (n ? e : t) || 0);
}, Nf = $r({
  devicePixelContentBoxSize: Eo(),
  borderBoxSize: Eo(),
  contentBoxSize: Eo(),
  contentRect: new qm(0, 0, 0, 0)
}), Xm = function(e, t) {
  if (t === void 0 && (t = !1), Bs.has(e) && !t)
    return Bs.get(e);
  if (Zm(e))
    return Bs.set(e, Nf), Nf;
  var n = getComputedStyle(e), r = ju(e) && e.ownerSVGElement && e.getBBox(), o = !QC && n.boxSizing === "border-box", i = JC.test(n.writingMode || ""), s = !r && If.test(n.overflowY || ""), a = !r && If.test(n.overflowX || ""), l = r ? 0 : on(n.paddingTop), c = r ? 0 : on(n.paddingRight), u = r ? 0 : on(n.paddingBottom), d = r ? 0 : on(n.paddingLeft), f = r ? 0 : on(n.borderTopWidth), m = r ? 0 : on(n.borderRightWidth), h = r ? 0 : on(n.borderBottomWidth), p = r ? 0 : on(n.borderLeftWidth), g = d + c, v = l + u, y = p + m, b = f + h, E = a ? e.offsetHeight - b - e.clientHeight : 0, S = s ? e.offsetWidth - y - e.clientWidth : 0, T = o ? g + y : 0, C = o ? v + b : 0, _ = r ? r.width : on(n.width) - T - S, w = r ? r.height : on(n.height) - C - E, R = _ + g + S + y, O = w + v + E + b, I = $r({
    devicePixelContentBoxSize: Eo(Math.round(_ * devicePixelRatio), Math.round(w * devicePixelRatio), i),
    borderBoxSize: Eo(R, O, i),
    contentBoxSize: Eo(_, w, i),
    contentRect: new qm(d, l, _, w)
  });
  return Bs.set(e, I), I;
}, Jm = function(e, t, n) {
  var r = Xm(e, n), o = r.borderBoxSize, i = r.contentBoxSize, s = r.devicePixelContentBoxSize;
  switch (t) {
    case Ki.DEVICE_PIXEL_CONTENT_BOX:
      return s;
    case Ki.BORDER_BOX:
      return o;
    default:
      return i;
  }
}, ew = /* @__PURE__ */ function() {
  function e(t) {
    var n = Xm(t);
    this.target = t, this.contentRect = n.contentRect, this.borderBoxSize = $r([n.borderBoxSize]), this.contentBoxSize = $r([n.contentBoxSize]), this.devicePixelContentBoxSize = $r([n.devicePixelContentBoxSize]);
  }
  return e;
}(), Qm = function(e) {
  if (Zm(e))
    return 1 / 0;
  for (var t = 0, n = e.parentNode; n; )
    t += 1, n = n.parentNode;
  return t;
}, tw = function() {
  var e = 1 / 0, t = [];
  Mr.forEach(function(s) {
    if (s.activeTargets.length !== 0) {
      var a = [];
      s.activeTargets.forEach(function(c) {
        var u = new ew(c.target), d = Qm(c.target);
        a.push(u), c.lastReportedSize = Jm(c.target, c.observedBox), d < e && (e = d);
      }), t.push(function() {
        s.callback.call(s.observer, a, s.observer);
      }), s.activeTargets.splice(0, s.activeTargets.length);
    }
  });
  for (var n = 0, r = t; n < r.length; n++) {
    var o = r[n];
    o();
  }
  return e;
}, Tf = function(e) {
  Mr.forEach(function(n) {
    n.activeTargets.splice(0, n.activeTargets.length), n.skippedTargets.splice(0, n.skippedTargets.length), n.observationTargets.forEach(function(o) {
      o.isActive() && (Qm(o.target) > e ? n.activeTargets.push(o) : n.skippedTargets.push(o));
    });
  });
}, nw = function() {
  var e = 0;
  for (Tf(e); GC(); )
    e = tw(), Tf(e);
  return YC() && qC(), e > 0;
}, kl, eg = [], rw = function() {
  return eg.splice(0).forEach(function(e) {
    return e();
  });
}, ow = function(e) {
  if (!kl) {
    var t = 0, n = document.createTextNode(""), r = { characterData: !0 };
    new MutationObserver(function() {
      return rw();
    }).observe(n, r), kl = function() {
      n.textContent = "".concat(t ? t-- : t++);
    };
  }
  eg.push(e), kl();
}, iw = function(e) {
  ow(function() {
    requestAnimationFrame(e);
  });
}, sa = 0, sw = function() {
  return !!sa;
}, aw = 250, lw = { attributes: !0, characterData: !0, childList: !0, subtree: !0 }, Of = [
  "resize",
  "load",
  "transitionend",
  "animationend",
  "animationstart",
  "animationiteration",
  "keyup",
  "keydown",
  "mouseup",
  "mousedown",
  "mouseover",
  "mouseout",
  "blur",
  "focus"
], Af = function(e) {
  return e === void 0 && (e = 0), Date.now() + e;
}, Rl = !1, cw = function() {
  function e() {
    var t = this;
    this.stopped = !0, this.listener = function() {
      return t.schedule();
    };
  }
  return e.prototype.run = function(t) {
    var n = this;
    if (t === void 0 && (t = aw), !Rl) {
      Rl = !0;
      var r = Af(t);
      iw(function() {
        var o = !1;
        try {
          o = nw();
        } finally {
          if (Rl = !1, t = r - Af(), !sw())
            return;
          o ? n.run(1e3) : t > 0 ? n.run(t) : n.start();
        }
      });
    }
  }, e.prototype.schedule = function() {
    this.stop(), this.run();
  }, e.prototype.observe = function() {
    var t = this, n = function() {
      return t.observer && t.observer.observe(document.body, lw);
    };
    document.body ? n() : xi.addEventListener("DOMContentLoaded", n);
  }, e.prototype.start = function() {
    var t = this;
    this.stopped && (this.stopped = !1, this.observer = new MutationObserver(this.listener), this.observe(), Of.forEach(function(n) {
      return xi.addEventListener(n, t.listener, !0);
    }));
  }, e.prototype.stop = function() {
    var t = this;
    this.stopped || (this.observer && this.observer.disconnect(), Of.forEach(function(n) {
      return xi.removeEventListener(n, t.listener, !0);
    }), this.stopped = !0);
  }, e;
}(), Tc = new cw(), Df = function(e) {
  !sa && e > 0 && Tc.start(), sa += e, !sa && Tc.stop();
}, uw = function(e) {
  return !ju(e) && !XC(e) && getComputedStyle(e).display === "inline";
}, dw = function() {
  function e(t, n) {
    this.target = t, this.observedBox = n || Ki.CONTENT_BOX, this.lastReportedSize = {
      inlineSize: 0,
      blockSize: 0
    };
  }
  return e.prototype.isActive = function() {
    var t = Jm(this.target, this.observedBox, !0);
    return uw(this.target) && (this.lastReportedSize = t), this.lastReportedSize.inlineSize !== t.inlineSize || this.lastReportedSize.blockSize !== t.blockSize;
  }, e;
}(), fw = /* @__PURE__ */ function() {
  function e(t, n) {
    this.activeTargets = [], this.skippedTargets = [], this.observationTargets = [], this.observer = t, this.callback = n;
  }
  return e;
}(), Ls = /* @__PURE__ */ new WeakMap(), Mf = function(e, t) {
  for (var n = 0; n < e.length; n += 1)
    if (e[n].target === t)
      return n;
  return -1;
}, Vs = function() {
  function e() {
  }
  return e.connect = function(t, n) {
    var r = new fw(t, n);
    Ls.set(t, r);
  }, e.observe = function(t, n, r) {
    var o = Ls.get(t), i = o.observationTargets.length === 0;
    Mf(o.observationTargets, n) < 0 && (i && Mr.push(o), o.observationTargets.push(new dw(n, r && r.box)), Df(1), Tc.schedule());
  }, e.unobserve = function(t, n) {
    var r = Ls.get(t), o = Mf(r.observationTargets, n), i = r.observationTargets.length === 1;
    o >= 0 && (i && Mr.splice(Mr.indexOf(r), 1), r.observationTargets.splice(o, 1), Df(-1));
  }, e.disconnect = function(t) {
    var n = this, r = Ls.get(t);
    r.observationTargets.slice().forEach(function(o) {
      return n.unobserve(t, o.target);
    }), r.activeTargets.splice(0, r.activeTargets.length);
  }, e;
}(), hw = function() {
  function e(t) {
    if (arguments.length === 0)
      throw new TypeError("Failed to construct 'ResizeObserver': 1 argument required, but only 0 present.");
    if (typeof t != "function")
      throw new TypeError("Failed to construct 'ResizeObserver': The callback provided as parameter 1 is not a function.");
    Vs.connect(this, t);
  }
  return e.prototype.observe = function(t, n) {
    if (arguments.length === 0)
      throw new TypeError("Failed to execute 'observe' on 'ResizeObserver': 1 argument required, but only 0 present.");
    if (!_f(t))
      throw new TypeError("Failed to execute 'observe' on 'ResizeObserver': parameter 1 is not of type 'Element");
    Vs.observe(this, t, n);
  }, e.prototype.unobserve = function(t) {
    if (arguments.length === 0)
      throw new TypeError("Failed to execute 'unobserve' on 'ResizeObserver': 1 argument required, but only 0 present.");
    if (!_f(t))
      throw new TypeError("Failed to execute 'unobserve' on 'ResizeObserver': parameter 1 is not of type 'Element");
    Vs.unobserve(this, t);
  }, e.prototype.disconnect = function() {
    Vs.disconnect(this);
  }, e.toString = function() {
    return "function ResizeObserver () { [polyfill code] }";
  }, e;
}();
class pw {
  constructor() {
    this.handleResize = this.handleResize.bind(this), this.observer = new (typeof window < "u" && window.ResizeObserver || hw)(this.handleResize), this.elHandlersMap = /* @__PURE__ */ new Map();
  }
  handleResize(t) {
    for (const n of t) {
      const r = this.elHandlersMap.get(n.target);
      r !== void 0 && r(n);
    }
  }
  registerHandler(t, n) {
    this.elHandlersMap.set(t, n), this.observer.observe(t);
  }
  unregisterHandler(t) {
    this.elHandlersMap.has(t) && (this.elHandlersMap.delete(t), this.observer.unobserve(t));
  }
}
const $f = new pw(), kf = /* @__PURE__ */ bt({
  name: "ResizeObserver",
  props: {
    onResize: Function
  },
  setup(e) {
    let t = !1;
    const n = ll().proxy;
    function r(o) {
      const { onResize: i } = e;
      i !== void 0 && i(o);
    }
    lr(() => {
      const o = n.$el;
      if (o === void 0) {
        xf("resize-observer", "$el does not exist.");
        return;
      }
      if (o.nextElementSibling !== o.nextSibling && o.nodeType === 3 && o.nodeValue !== "") {
        xf("resize-observer", "$el can not be observed (it may be a text node).");
        return;
      }
      o.nextElementSibling !== null && ($f.registerHandler(o.nextElementSibling, r), t = !0);
    }), nn(() => {
      t && $f.unregisterHandler(n.$el.nextElementSibling);
    });
  },
  render() {
    return c0(this.$slots, "default");
  }
});
function tg(e) {
  return e instanceof HTMLElement;
}
function ng(e) {
  for (let t = 0; t < e.childNodes.length; t++) {
    const n = e.childNodes[t];
    if (tg(n) && (og(n) || ng(n)))
      return !0;
  }
  return !1;
}
function rg(e) {
  for (let t = e.childNodes.length - 1; t >= 0; t--) {
    const n = e.childNodes[t];
    if (tg(n) && (og(n) || rg(n)))
      return !0;
  }
  return !1;
}
function og(e) {
  if (!mw(e))
    return !1;
  try {
    e.focus({ preventScroll: !0 });
  } catch {
  }
  return document.activeElement === e;
}
function mw(e) {
  if (e.tabIndex > 0 || e.tabIndex === 0 && e.getAttribute("tabIndex") !== null)
    return !0;
  if (e.getAttribute("disabled"))
    return !1;
  switch (e.nodeName) {
    case "A":
      return !!e.href && e.rel !== "ignore";
    case "INPUT":
      return e.type !== "hidden" && e.type !== "file";
    case "BUTTON":
    case "SELECT":
    case "TEXTAREA":
      return !0;
    default:
      return !1;
  }
}
let ti = [];
const gw = /* @__PURE__ */ bt({
  name: "FocusTrap",
  props: {
    disabled: Boolean,
    active: Boolean,
    autoFocus: {
      type: Boolean,
      default: !0
    },
    onEsc: Function,
    initialFocusTo: String,
    finalFocusTo: String,
    returnFocusOnDeactivated: {
      type: Boolean,
      default: !0
    }
  },
  setup(e) {
    const t = q1(), n = Ee(null), r = Ee(null);
    let o = !1, i = !1;
    const s = typeof document > "u" ? null : document.activeElement;
    function a() {
      return ti[ti.length - 1] === t;
    }
    function l(g) {
      var v;
      g.code === "Escape" && a() && ((v = e.onEsc) === null || v === void 0 || v.call(e, g));
    }
    lr(() => {
      _n(() => e.active, (g) => {
        g ? (d(), Wt("keydown", document, l)) : (Ot("keydown", document, l), o && f());
      }, {
        immediate: !0
      });
    }), nn(() => {
      Ot("keydown", document, l), o && f();
    });
    function c(g) {
      if (!i && a()) {
        const v = u();
        if (v === null || v.contains(Lu(g)))
          return;
        m("first");
      }
    }
    function u() {
      const g = n.value;
      if (g === null)
        return null;
      let v = g;
      for (; v = v.nextSibling, !(v === null || v instanceof Element && v.tagName === "DIV"); )
        ;
      return v;
    }
    function d() {
      var g;
      if (!e.disabled) {
        if (ti.push(t), e.autoFocus) {
          const { initialFocusTo: v } = e;
          v === void 0 ? m("first") : (g = Sf(v)) === null || g === void 0 || g.focus({ preventScroll: !0 });
        }
        o = !0, document.addEventListener("focus", c, !0);
      }
    }
    function f() {
      var g;
      if (e.disabled || (document.removeEventListener("focus", c, !0), ti = ti.filter((y) => y !== t), a()))
        return;
      const { finalFocusTo: v } = e;
      v !== void 0 ? (g = Sf(v)) === null || g === void 0 || g.focus({ preventScroll: !0 }) : e.returnFocusOnDeactivated && s instanceof HTMLElement && (i = !0, s.focus({ preventScroll: !0 }), i = !1);
    }
    function m(g) {
      if (a() && e.active) {
        const v = n.value, y = r.value;
        if (v !== null && y !== null) {
          const b = u();
          if (b == null || b === y) {
            i = !0, v.focus({ preventScroll: !0 }), i = !1;
            return;
          }
          i = !0;
          const E = g === "first" ? ng(b) : rg(b);
          i = !1, E || (i = !0, v.focus({ preventScroll: !0 }), i = !1);
        }
      }
    }
    function h(g) {
      if (i)
        return;
      const v = u();
      v !== null && (g.relatedTarget !== null && v.contains(g.relatedTarget) ? m("last") : m("first"));
    }
    function p(g) {
      i || (g.relatedTarget !== null && g.relatedTarget === n.value ? m("last") : m("first"));
    }
    return {
      focusableStartRef: n,
      focusableEndRef: r,
      focusableStyle: "position: absolute; height: 0; width: 0;",
      handleStartFocus: h,
      handleEndFocus: p
    };
  },
  render() {
    const { default: e } = this.$slots;
    if (e === void 0)
      return null;
    if (this.disabled)
      return e();
    const { active: t, focusableStyle: n } = this;
    return q(dt, null, [
      q("div", {
        "aria-hidden": "true",
        tabindex: t ? "0" : "-1",
        ref: "focusableStartRef",
        style: n,
        onFocus: this.handleStartFocus
      }),
      e(),
      q("div", {
        "aria-hidden": "true",
        style: n,
        ref: "focusableEndRef",
        tabindex: t ? "0" : "-1",
        onFocus: this.handleEndFocus
      })
    ]);
  }
});
let to = 0, Rf = "", Pf = "", Ff = "", Bf = "";
const Lf = Ee("0px");
function vw(e) {
  if (typeof document > "u")
    return;
  const t = document.documentElement;
  let n, r = !1;
  const o = () => {
    t.style.marginRight = Rf, t.style.overflow = Pf, t.style.overflowX = Ff, t.style.overflowY = Bf, Lf.value = "0px";
  };
  lr(() => {
    n = _n(e, (i) => {
      if (i) {
        if (!to) {
          const s = window.innerWidth - t.offsetWidth;
          s > 0 && (Rf = t.style.marginRight, t.style.marginRight = `${s}px`, Lf.value = `${s}px`), Pf = t.style.overflow, Ff = t.style.overflowX, Bf = t.style.overflowY, t.style.overflow = "hidden", t.style.overflowX = "hidden", t.style.overflowY = "hidden";
        }
        r = !0, to++;
      } else
        to--, to || o(), r = !1;
    }, {
      immediate: !0
    });
  }), nn(() => {
    n == null || n(), r && (to--, to || o(), r = !1);
  });
}
const Hu = Ee(!1), Vf = () => {
  Hu.value = !0;
}, zf = () => {
  Hu.value = !1;
};
let ni = 0;
const yw = () => (us && (Yr(() => {
  ni || (window.addEventListener("compositionstart", Vf), window.addEventListener("compositionend", zf)), ni++;
}), nn(() => {
  ni <= 1 ? (window.removeEventListener("compositionstart", Vf), window.removeEventListener("compositionend", zf), ni = 0) : ni--;
})), Hu);
function bw(e) {
  const t = {
    isDeactivated: !1
  };
  let n = !1;
  return tm(() => {
    if (t.isDeactivated = !1, !n) {
      n = !0;
      return;
    }
    e();
  }), nm(() => {
    t.isDeactivated = !0, n || (n = !0);
  }), t;
}
const jf = "n-form-item";
function Cw(e, {
  defaultSize: t = "medium",
  mergedSize: n,
  mergedDisabled: r
} = {}) {
  const o = $t(jf, null);
  xo(jf, null);
  const i = Te(n ? () => n(o) : () => {
    const {
      size: l
    } = e;
    if (l)
      return l;
    if (o) {
      const {
        mergedSize: c
      } = o;
      if (c.value !== void 0)
        return c.value;
    }
    return t;
  }), s = Te(r ? () => r(o) : () => {
    const {
      disabled: l
    } = e;
    return l !== void 0 ? l : o ? o.disabled.value : !1;
  }), a = Te(() => {
    const {
      status: l
    } = e;
    return l || (o == null ? void 0 : o.mergedValidationStatus.value);
  });
  return nn(() => {
    o && o.restoreValidation();
  }), {
    mergedSizeRef: i,
    mergedDisabledRef: s,
    mergedStatusRef: a,
    nTriggerFormBlur() {
      o && o.handleContentBlur();
    },
    nTriggerFormChange() {
      o && o.handleContentChange();
    },
    nTriggerFormFocus() {
      o && o.handleContentFocus();
    },
    nTriggerFormInput() {
      o && o.handleContentInput();
    }
  };
}
var ig = typeof global == "object" && global && global.Object === Object && global, ww = typeof self == "object" && self && self.Object === Object && self, Vo = ig || ww || Function("return this")(), Mo = Vo.Symbol, sg = Object.prototype, xw = sg.hasOwnProperty, Sw = sg.toString, ri = Mo ? Mo.toStringTag : void 0;
function Ew(e) {
  var t = xw.call(e, ri), n = e[ri];
  try {
    e[ri] = void 0;
    var r = !0;
  } catch {
  }
  var o = Sw.call(e);
  return r && (t ? e[ri] = n : delete e[ri]), o;
}
var _w = Object.prototype, Iw = _w.toString;
function Nw(e) {
  return Iw.call(e);
}
var Tw = "[object Null]", Ow = "[object Undefined]", Hf = Mo ? Mo.toStringTag : void 0;
function ds(e) {
  return e == null ? e === void 0 ? Ow : Tw : Hf && Hf in Object(e) ? Ew(e) : Nw(e);
}
function zo(e) {
  return e != null && typeof e == "object";
}
var Aw = "[object Symbol]";
function Dw(e) {
  return typeof e == "symbol" || zo(e) && ds(e) == Aw;
}
function Mw(e, t) {
  for (var n = -1, r = e == null ? 0 : e.length, o = Array(r); ++n < r; )
    o[n] = t(e[n], n, e);
  return o;
}
var Oa = Array.isArray, $w = 1 / 0, Wf = Mo ? Mo.prototype : void 0, Uf = Wf ? Wf.toString : void 0;
function ag(e) {
  if (typeof e == "string")
    return e;
  if (Oa(e))
    return Mw(e, ag) + "";
  if (Dw(e))
    return Uf ? Uf.call(e) : "";
  var t = e + "";
  return t == "0" && 1 / e == -$w ? "-0" : t;
}
function qr(e) {
  var t = typeof e;
  return e != null && (t == "object" || t == "function");
}
function lg(e) {
  return e;
}
var kw = "[object AsyncFunction]", Rw = "[object Function]", Pw = "[object GeneratorFunction]", Fw = "[object Proxy]";
function Wu(e) {
  if (!qr(e))
    return !1;
  var t = ds(e);
  return t == Rw || t == Pw || t == kw || t == Fw;
}
var Pl = Vo["__core-js_shared__"], Kf = function() {
  var e = /[^.]+$/.exec(Pl && Pl.keys && Pl.keys.IE_PROTO || "");
  return e ? "Symbol(src)_1." + e : "";
}();
function Bw(e) {
  return !!Kf && Kf in e;
}
var Lw = Function.prototype, Vw = Lw.toString;
function zw(e) {
  if (e != null) {
    try {
      return Vw.call(e);
    } catch {
    }
    try {
      return e + "";
    } catch {
    }
  }
  return "";
}
var jw = /[\\^$.*+?()[\]{}|]/g, Hw = /^\[object .+?Constructor\]$/, Ww = Function.prototype, Uw = Object.prototype, Kw = Ww.toString, Gw = Uw.hasOwnProperty, Yw = RegExp(
  "^" + Kw.call(Gw).replace(jw, "\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, "$1.*?") + "$"
);
function qw(e) {
  if (!qr(e) || Bw(e))
    return !1;
  var t = Wu(e) ? Yw : Hw;
  return t.test(zw(e));
}
function Zw(e, t) {
  return e == null ? void 0 : e[t];
}
function Uu(e, t) {
  var n = Zw(e, t);
  return qw(n) ? n : void 0;
}
var Gf = Object.create, Xw = /* @__PURE__ */ function() {
  function e() {
  }
  return function(t) {
    if (!qr(t))
      return {};
    if (Gf)
      return Gf(t);
    e.prototype = t;
    var n = new e();
    return e.prototype = void 0, n;
  };
}();
function Jw(e, t, n) {
  switch (n.length) {
    case 0:
      return e.call(t);
    case 1:
      return e.call(t, n[0]);
    case 2:
      return e.call(t, n[0], n[1]);
    case 3:
      return e.call(t, n[0], n[1], n[2]);
  }
  return e.apply(t, n);
}
function Qw(e, t) {
  var n = -1, r = e.length;
  for (t || (t = Array(r)); ++n < r; )
    t[n] = e[n];
  return t;
}
var ex = 800, tx = 16, nx = Date.now;
function rx(e) {
  var t = 0, n = 0;
  return function() {
    var r = nx(), o = tx - (r - n);
    if (n = r, o > 0) {
      if (++t >= ex)
        return arguments[0];
    } else
      t = 0;
    return e.apply(void 0, arguments);
  };
}
function ox(e) {
  return function() {
    return e;
  };
}
var Aa = function() {
  try {
    var e = Uu(Object, "defineProperty");
    return e({}, "", {}), e;
  } catch {
  }
}(), ix = Aa ? function(e, t) {
  return Aa(e, "toString", {
    configurable: !0,
    enumerable: !1,
    value: ox(t),
    writable: !0
  });
} : lg;
const sx = ix;
var ax = rx(sx), lx = 9007199254740991, cx = /^(?:0|[1-9]\d*)$/;
function cg(e, t) {
  var n = typeof e;
  return t = t ?? lx, !!t && (n == "number" || n != "symbol" && cx.test(e)) && e > -1 && e % 1 == 0 && e < t;
}
function Ku(e, t, n) {
  t == "__proto__" && Aa ? Aa(e, t, {
    configurable: !0,
    enumerable: !0,
    value: n,
    writable: !0
  }) : e[t] = n;
}
function pl(e, t) {
  return e === t || e !== e && t !== t;
}
var ux = Object.prototype, dx = ux.hasOwnProperty;
function fx(e, t, n) {
  var r = e[t];
  (!(dx.call(e, t) && pl(r, n)) || n === void 0 && !(t in e)) && Ku(e, t, n);
}
function hx(e, t, n, r) {
  var o = !n;
  n || (n = {});
  for (var i = -1, s = t.length; ++i < s; ) {
    var a = t[i], l = r ? r(n[a], e[a], a, n, e) : void 0;
    l === void 0 && (l = e[a]), o ? Ku(n, a, l) : fx(n, a, l);
  }
  return n;
}
var Yf = Math.max;
function px(e, t, n) {
  return t = Yf(t === void 0 ? e.length - 1 : t, 0), function() {
    for (var r = arguments, o = -1, i = Yf(r.length - t, 0), s = Array(i); ++o < i; )
      s[o] = r[t + o];
    o = -1;
    for (var a = Array(t + 1); ++o < t; )
      a[o] = r[o];
    return a[t] = n(s), Jw(e, this, a);
  };
}
function mx(e, t) {
  return ax(px(e, t, lg), e + "");
}
var gx = 9007199254740991;
function ug(e) {
  return typeof e == "number" && e > -1 && e % 1 == 0 && e <= gx;
}
function Gu(e) {
  return e != null && ug(e.length) && !Wu(e);
}
function vx(e, t, n) {
  if (!qr(n))
    return !1;
  var r = typeof t;
  return (r == "number" ? Gu(n) && cg(t, n.length) : r == "string" && t in n) ? pl(n[t], e) : !1;
}
function yx(e) {
  return mx(function(t, n) {
    var r = -1, o = n.length, i = o > 1 ? n[o - 1] : void 0, s = o > 2 ? n[2] : void 0;
    for (i = e.length > 3 && typeof i == "function" ? (o--, i) : void 0, s && vx(n[0], n[1], s) && (i = o < 3 ? void 0 : i, o = 1), t = Object(t); ++r < o; ) {
      var a = n[r];
      a && e(t, a, r, i);
    }
    return t;
  });
}
var bx = Object.prototype;
function dg(e) {
  var t = e && e.constructor, n = typeof t == "function" && t.prototype || bx;
  return e === n;
}
function Cx(e, t) {
  for (var n = -1, r = Array(e); ++n < e; )
    r[n] = t(n);
  return r;
}
var wx = "[object Arguments]";
function qf(e) {
  return zo(e) && ds(e) == wx;
}
var fg = Object.prototype, xx = fg.hasOwnProperty, Sx = fg.propertyIsEnumerable, Ex = qf(/* @__PURE__ */ function() {
  return arguments;
}()) ? qf : function(e) {
  return zo(e) && xx.call(e, "callee") && !Sx.call(e, "callee");
};
const Oc = Ex;
function _x() {
  return !1;
}
var hg = typeof exports == "object" && exports && !exports.nodeType && exports, Zf = hg && typeof module == "object" && module && !module.nodeType && module, Ix = Zf && Zf.exports === hg, Xf = Ix ? Vo.Buffer : void 0, Nx = Xf ? Xf.isBuffer : void 0, pg = Nx || _x, Tx = "[object Arguments]", Ox = "[object Array]", Ax = "[object Boolean]", Dx = "[object Date]", Mx = "[object Error]", $x = "[object Function]", kx = "[object Map]", Rx = "[object Number]", Px = "[object Object]", Fx = "[object RegExp]", Bx = "[object Set]", Lx = "[object String]", Vx = "[object WeakMap]", zx = "[object ArrayBuffer]", jx = "[object DataView]", Hx = "[object Float32Array]", Wx = "[object Float64Array]", Ux = "[object Int8Array]", Kx = "[object Int16Array]", Gx = "[object Int32Array]", Yx = "[object Uint8Array]", qx = "[object Uint8ClampedArray]", Zx = "[object Uint16Array]", Xx = "[object Uint32Array]", Ke = {};
Ke[Hx] = Ke[Wx] = Ke[Ux] = Ke[Kx] = Ke[Gx] = Ke[Yx] = Ke[qx] = Ke[Zx] = Ke[Xx] = !0;
Ke[Tx] = Ke[Ox] = Ke[zx] = Ke[Ax] = Ke[jx] = Ke[Dx] = Ke[Mx] = Ke[$x] = Ke[kx] = Ke[Rx] = Ke[Px] = Ke[Fx] = Ke[Bx] = Ke[Lx] = Ke[Vx] = !1;
function Jx(e) {
  return zo(e) && ug(e.length) && !!Ke[ds(e)];
}
function Qx(e) {
  return function(t) {
    return e(t);
  };
}
var mg = typeof exports == "object" && exports && !exports.nodeType && exports, Si = mg && typeof module == "object" && module && !module.nodeType && module, eS = Si && Si.exports === mg, Fl = eS && ig.process, Jf = function() {
  try {
    var e = Si && Si.require && Si.require("util").types;
    return e || Fl && Fl.binding && Fl.binding("util");
  } catch {
  }
}(), Qf = Jf && Jf.isTypedArray, gg = Qf ? Qx(Qf) : Jx, tS = Object.prototype, nS = tS.hasOwnProperty;
function rS(e, t) {
  var n = Oa(e), r = !n && Oc(e), o = !n && !r && pg(e), i = !n && !r && !o && gg(e), s = n || r || o || i, a = s ? Cx(e.length, String) : [], l = a.length;
  for (var c in e)
    (t || nS.call(e, c)) && !(s && // Safari 9 has enumerable `arguments.length` in strict mode.
    (c == "length" || // Node.js 0.10 has enumerable non-index properties on buffers.
    o && (c == "offset" || c == "parent") || // PhantomJS 2 has enumerable non-index properties on typed arrays.
    i && (c == "buffer" || c == "byteLength" || c == "byteOffset") || // Skip index properties.
    cg(c, l))) && a.push(c);
  return a;
}
function oS(e, t) {
  return function(n) {
    return e(t(n));
  };
}
function iS(e) {
  var t = [];
  if (e != null)
    for (var n in Object(e))
      t.push(n);
  return t;
}
var sS = Object.prototype, aS = sS.hasOwnProperty;
function lS(e) {
  if (!qr(e))
    return iS(e);
  var t = dg(e), n = [];
  for (var r in e)
    r == "constructor" && (t || !aS.call(e, r)) || n.push(r);
  return n;
}
function vg(e) {
  return Gu(e) ? rS(e, !0) : lS(e);
}
var Gi = Uu(Object, "create");
function cS() {
  this.__data__ = Gi ? Gi(null) : {}, this.size = 0;
}
function uS(e) {
  var t = this.has(e) && delete this.__data__[e];
  return this.size -= t ? 1 : 0, t;
}
var dS = "__lodash_hash_undefined__", fS = Object.prototype, hS = fS.hasOwnProperty;
function pS(e) {
  var t = this.__data__;
  if (Gi) {
    var n = t[e];
    return n === dS ? void 0 : n;
  }
  return hS.call(t, e) ? t[e] : void 0;
}
var mS = Object.prototype, gS = mS.hasOwnProperty;
function vS(e) {
  var t = this.__data__;
  return Gi ? t[e] !== void 0 : gS.call(t, e);
}
var yS = "__lodash_hash_undefined__";
function bS(e, t) {
  var n = this.__data__;
  return this.size += this.has(e) ? 0 : 1, n[e] = Gi && t === void 0 ? yS : t, this;
}
function jr(e) {
  var t = -1, n = e == null ? 0 : e.length;
  for (this.clear(); ++t < n; ) {
    var r = e[t];
    this.set(r[0], r[1]);
  }
}
jr.prototype.clear = cS;
jr.prototype.delete = uS;
jr.prototype.get = pS;
jr.prototype.has = vS;
jr.prototype.set = bS;
function CS() {
  this.__data__ = [], this.size = 0;
}
function ml(e, t) {
  for (var n = e.length; n--; )
    if (pl(e[n][0], t))
      return n;
  return -1;
}
var wS = Array.prototype, xS = wS.splice;
function SS(e) {
  var t = this.__data__, n = ml(t, e);
  if (n < 0)
    return !1;
  var r = t.length - 1;
  return n == r ? t.pop() : xS.call(t, n, 1), --this.size, !0;
}
function ES(e) {
  var t = this.__data__, n = ml(t, e);
  return n < 0 ? void 0 : t[n][1];
}
function _S(e) {
  return ml(this.__data__, e) > -1;
}
function IS(e, t) {
  var n = this.__data__, r = ml(n, e);
  return r < 0 ? (++this.size, n.push([e, t])) : n[r][1] = t, this;
}
function Mn(e) {
  var t = -1, n = e == null ? 0 : e.length;
  for (this.clear(); ++t < n; ) {
    var r = e[t];
    this.set(r[0], r[1]);
  }
}
Mn.prototype.clear = CS;
Mn.prototype.delete = SS;
Mn.prototype.get = ES;
Mn.prototype.has = _S;
Mn.prototype.set = IS;
var yg = Uu(Vo, "Map");
function NS() {
  this.size = 0, this.__data__ = {
    hash: new jr(),
    map: new (yg || Mn)(),
    string: new jr()
  };
}
function TS(e) {
  var t = typeof e;
  return t == "string" || t == "number" || t == "symbol" || t == "boolean" ? e !== "__proto__" : e === null;
}
function gl(e, t) {
  var n = e.__data__;
  return TS(t) ? n[typeof t == "string" ? "string" : "hash"] : n.map;
}
function OS(e) {
  var t = gl(this, e).delete(e);
  return this.size -= t ? 1 : 0, t;
}
function AS(e) {
  return gl(this, e).get(e);
}
function DS(e) {
  return gl(this, e).has(e);
}
function MS(e, t) {
  var n = gl(this, e), r = n.size;
  return n.set(e, t), this.size += n.size == r ? 0 : 1, this;
}
function jo(e) {
  var t = -1, n = e == null ? 0 : e.length;
  for (this.clear(); ++t < n; ) {
    var r = e[t];
    this.set(r[0], r[1]);
  }
}
jo.prototype.clear = NS;
jo.prototype.delete = OS;
jo.prototype.get = AS;
jo.prototype.has = DS;
jo.prototype.set = MS;
function $S(e) {
  return e == null ? "" : ag(e);
}
var bg = oS(Object.getPrototypeOf, Object), kS = "[object Object]", RS = Function.prototype, PS = Object.prototype, Cg = RS.toString, FS = PS.hasOwnProperty, BS = Cg.call(Object);
function LS(e) {
  if (!zo(e) || ds(e) != kS)
    return !1;
  var t = bg(e);
  if (t === null)
    return !0;
  var n = FS.call(t, "constructor") && t.constructor;
  return typeof n == "function" && n instanceof n && Cg.call(n) == BS;
}
function VS(e, t, n) {
  var r = -1, o = e.length;
  t < 0 && (t = -t > o ? 0 : o + t), n = n > o ? o : n, n < 0 && (n += o), o = t > n ? 0 : n - t >>> 0, t >>>= 0;
  for (var i = Array(o); ++r < o; )
    i[r] = e[r + t];
  return i;
}
function zS(e, t, n) {
  var r = e.length;
  return n = n === void 0 ? r : n, !t && n >= r ? e : VS(e, t, n);
}
var jS = "\\ud800-\\udfff", HS = "\\u0300-\\u036f", WS = "\\ufe20-\\ufe2f", US = "\\u20d0-\\u20ff", KS = HS + WS + US, GS = "\\ufe0e\\ufe0f", YS = "\\u200d", qS = RegExp("[" + YS + jS + KS + GS + "]");
function wg(e) {
  return qS.test(e);
}
function ZS(e) {
  return e.split("");
}
var xg = "\\ud800-\\udfff", XS = "\\u0300-\\u036f", JS = "\\ufe20-\\ufe2f", QS = "\\u20d0-\\u20ff", eE = XS + JS + QS, tE = "\\ufe0e\\ufe0f", nE = "[" + xg + "]", Ac = "[" + eE + "]", Dc = "\\ud83c[\\udffb-\\udfff]", rE = "(?:" + Ac + "|" + Dc + ")", Sg = "[^" + xg + "]", Eg = "(?:\\ud83c[\\udde6-\\uddff]){2}", _g = "[\\ud800-\\udbff][\\udc00-\\udfff]", oE = "\\u200d", Ig = rE + "?", Ng = "[" + tE + "]?", iE = "(?:" + oE + "(?:" + [Sg, Eg, _g].join("|") + ")" + Ng + Ig + ")*", sE = Ng + Ig + iE, aE = "(?:" + [Sg + Ac + "?", Ac, Eg, _g, nE].join("|") + ")", lE = RegExp(Dc + "(?=" + Dc + ")|" + aE + sE, "g");
function cE(e) {
  return e.match(lE) || [];
}
function uE(e) {
  return wg(e) ? cE(e) : ZS(e);
}
function dE(e) {
  return function(t) {
    t = $S(t);
    var n = wg(t) ? uE(t) : void 0, r = n ? n[0] : t.charAt(0), o = n ? zS(n, 1).join("") : t.slice(1);
    return r[e]() + o;
  };
}
var fE = dE("toUpperCase");
function hE() {
  this.__data__ = new Mn(), this.size = 0;
}
function pE(e) {
  var t = this.__data__, n = t.delete(e);
  return this.size = t.size, n;
}
function mE(e) {
  return this.__data__.get(e);
}
function gE(e) {
  return this.__data__.has(e);
}
var vE = 200;
function yE(e, t) {
  var n = this.__data__;
  if (n instanceof Mn) {
    var r = n.__data__;
    if (!yg || r.length < vE - 1)
      return r.push([e, t]), this.size = ++n.size, this;
    n = this.__data__ = new jo(r);
  }
  return n.set(e, t), this.size = n.size, this;
}
function Ho(e) {
  var t = this.__data__ = new Mn(e);
  this.size = t.size;
}
Ho.prototype.clear = hE;
Ho.prototype.delete = pE;
Ho.prototype.get = mE;
Ho.prototype.has = gE;
Ho.prototype.set = yE;
var Tg = typeof exports == "object" && exports && !exports.nodeType && exports, eh = Tg && typeof module == "object" && module && !module.nodeType && module, bE = eh && eh.exports === Tg, th = bE ? Vo.Buffer : void 0, nh = th ? th.allocUnsafe : void 0;
function CE(e, t) {
  if (t)
    return e.slice();
  var n = e.length, r = nh ? nh(n) : new e.constructor(n);
  return e.copy(r), r;
}
var rh = Vo.Uint8Array;
function wE(e) {
  var t = new e.constructor(e.byteLength);
  return new rh(t).set(new rh(e)), t;
}
function xE(e, t) {
  var n = t ? wE(e.buffer) : e.buffer;
  return new e.constructor(n, e.byteOffset, e.length);
}
function SE(e) {
  return typeof e.constructor == "function" && !dg(e) ? Xw(bg(e)) : {};
}
function EE(e) {
  return function(t, n, r) {
    for (var o = -1, i = Object(t), s = r(t), a = s.length; a--; ) {
      var l = s[e ? a : ++o];
      if (n(i[l], l, i) === !1)
        break;
    }
    return t;
  };
}
var _E = EE();
function Mc(e, t, n) {
  (n !== void 0 && !pl(e[t], n) || n === void 0 && !(t in e)) && Ku(e, t, n);
}
function IE(e) {
  return zo(e) && Gu(e);
}
function $c(e, t) {
  if (!(t === "constructor" && typeof e[t] == "function") && t != "__proto__")
    return e[t];
}
function NE(e) {
  return hx(e, vg(e));
}
function TE(e, t, n, r, o, i, s) {
  var a = $c(e, n), l = $c(t, n), c = s.get(l);
  if (c) {
    Mc(e, n, c);
    return;
  }
  var u = i ? i(a, l, n + "", e, t, s) : void 0, d = u === void 0;
  if (d) {
    var f = Oa(l), m = !f && pg(l), h = !f && !m && gg(l);
    u = l, f || m || h ? Oa(a) ? u = a : IE(a) ? u = Qw(a) : m ? (d = !1, u = CE(l, !0)) : h ? (d = !1, u = xE(l, !0)) : u = [] : LS(l) || Oc(l) ? (u = a, Oc(a) ? u = NE(a) : (!qr(a) || Wu(a)) && (u = SE(l))) : d = !1;
  }
  d && (s.set(l, u), o(u, l, r, i, s), s.delete(l)), Mc(e, n, u);
}
function Og(e, t, n, r, o) {
  e !== t && _E(t, function(i, s) {
    if (o || (o = new Ho()), qr(i))
      TE(e, t, s, n, Og, r, o);
    else {
      var a = r ? r($c(e, s), i, s + "", e, t, o) : void 0;
      a === void 0 && (a = i), Mc(e, s, a);
    }
  }, vg);
}
var zs = yx(function(e, t, n) {
  Og(e, t, n);
});
const Wo = {
  fontFamily: 'v-sans, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol"',
  fontFamilyMono: "v-mono, SFMono-Regular, Menlo, Consolas, Courier, monospace",
  fontWeight: "400",
  fontWeightStrong: "500",
  cubicBezierEaseInOut: "cubic-bezier(.4, 0, .2, 1)",
  cubicBezierEaseOut: "cubic-bezier(0, 0, .2, 1)",
  cubicBezierEaseIn: "cubic-bezier(.4, 0, 1, 1)",
  borderRadius: "3px",
  borderRadiusSmall: "2px",
  fontSize: "14px",
  fontSizeMini: "12px",
  fontSizeTiny: "12px",
  fontSizeSmall: "14px",
  fontSizeMedium: "14px",
  fontSizeLarge: "15px",
  fontSizeHuge: "16px",
  lineHeight: "1.6",
  heightMini: "16px",
  // private now, it's too small
  heightTiny: "22px",
  heightSmall: "28px",
  heightMedium: "34px",
  heightLarge: "40px",
  heightHuge: "46px"
}, {
  fontSize: OE,
  fontFamily: AE,
  lineHeight: DE
} = Wo, Ag = oe("body", `
 margin: 0;
 font-size: ${OE};
 font-family: ${AE};
 line-height: ${DE};
 -webkit-text-size-adjust: 100%;
 -webkit-tap-highlight-color: transparent;
`, [oe("input", `
 font-family: inherit;
 font-size: inherit;
 `)]), fs = "n-config-provider", Yi = "naive-ui-style";
function tn(e, t, n, r, o, i) {
  const s = hl(), a = $t(fs, null);
  if (n) {
    const c = () => {
      const u = i == null ? void 0 : i.value;
      n.mount({
        id: u === void 0 ? t : u + t,
        head: !0,
        props: {
          bPrefix: u ? `.${u}-` : void 0
        },
        anchorMetaName: Yi,
        ssr: s
      }), a != null && a.preflightStyleDisabled || Ag.mount({
        id: "n-global",
        head: !0,
        anchorMetaName: Yi,
        ssr: s
      });
    };
    s ? c() : Yr(c);
  }
  return Te(() => {
    var c;
    const {
      theme: {
        common: u,
        self: d,
        peers: f = {}
      } = {},
      themeOverrides: m = {},
      builtinThemeOverrides: h = {}
    } = o, {
      common: p,
      peers: g
    } = m, {
      common: v = void 0,
      [e]: {
        common: y = void 0,
        self: b = void 0,
        peers: E = {}
      } = {}
    } = (a == null ? void 0 : a.mergedThemeRef.value) || {}, {
      common: S = void 0,
      [e]: T = {}
    } = (a == null ? void 0 : a.mergedThemeOverridesRef.value) || {}, {
      common: C,
      peers: _ = {}
    } = T, w = zs({}, u || y || v || r.common, S, C, p), R = zs(
      // {}, executed every time, no need for empty obj
      (c = d || b || r.self) === null || c === void 0 ? void 0 : c(w),
      h,
      T,
      m
    );
    return {
      common: w,
      self: R,
      peers: zs({}, r.peers, E, f),
      peerOverrides: zs({}, h.peers, _, g)
    };
  });
}
tn.props = {
  theme: Object,
  themeOverrides: Object,
  builtinThemeOverrides: Object
};
const ME = "n";
function hs(e = {}, t = {
  defaultBordered: !0
}) {
  const n = $t(fs, null);
  return {
    // NConfigProvider,
    inlineThemeDisabled: n == null ? void 0 : n.inlineThemeDisabled,
    mergedRtlRef: n == null ? void 0 : n.mergedRtlRef,
    mergedComponentPropsRef: n == null ? void 0 : n.mergedComponentPropsRef,
    mergedBreakpointsRef: n == null ? void 0 : n.mergedBreakpointsRef,
    mergedBorderedRef: Te(() => {
      var r, o;
      const {
        bordered: i
      } = e;
      return i !== void 0 ? i : (o = (r = n == null ? void 0 : n.mergedBorderedRef.value) !== null && r !== void 0 ? r : t.defaultBordered) !== null && o !== void 0 ? o : !0;
    }),
    mergedClsPrefixRef: n ? n.mergedClsPrefixRef : mb(ME),
    namespaceRef: Te(() => n == null ? void 0 : n.mergedNamespaceRef.value)
  };
}
var $E = {};
function vl(e, t, n) {
  if (!t) {
    $E.NODE_ENV !== "production" && km("use-style", "No style is specified.");
    return;
  }
  const r = hl(), o = $t(fs, null), i = () => {
    const s = n.value;
    t.mount({
      id: s === void 0 ? e : s + e,
      head: !0,
      anchorMetaName: Yi,
      props: {
        bPrefix: s ? `.${s}-` : void 0
      },
      ssr: r
    }), o != null && o.preflightStyleDisabled || Ag.mount({
      id: "n-global",
      head: !0,
      anchorMetaName: Yi,
      ssr: r
    });
  };
  r ? i() : Yr(i);
}
function ps(e, t, n, r) {
  var o;
  n || km("useThemeClass", "cssVarsRef is not passed");
  const i = (o = $t(fs, null)) === null || o === void 0 ? void 0 : o.mergedThemeHashRef, s = Ee(""), a = hl();
  let l;
  const c = `__${e}`, u = () => {
    let d = c;
    const f = t ? t.value : void 0, m = i == null ? void 0 : i.value;
    m && (d += "-" + m), f && (d += "-" + f);
    const {
      themeOverrides: h,
      builtinThemeOverrides: p
    } = r;
    h && (d += "-" + Ic(JSON.stringify(h))), p && (d += "-" + Ic(JSON.stringify(p))), s.value = d, l = () => {
      const g = n.value;
      let v = "";
      for (const y in g)
        v += `${y}: ${g[y]};`;
      oe(`.${d}`, v).mount({
        id: d,
        ssr: a
      }), l = void 0;
    };
  };
  return il(() => {
    u();
  }), {
    themeClass: s,
    onRender: () => {
      l == null || l();
    }
  };
}
function yl(e, t, n) {
  if (!t)
    return;
  const r = hl(), o = Te(() => {
    const {
      value: s
    } = t;
    if (!s)
      return;
    const a = s[e];
    if (a)
      return a;
  }), i = () => {
    il(() => {
      const {
        value: s
      } = n, a = `${s}${e}Rtl`;
      if (pC(a, r))
        return;
      const {
        value: l
      } = o;
      l && l.style.mount({
        id: a,
        head: !0,
        anchorMetaName: Yi,
        props: {
          bPrefix: s ? `.${s}-` : void 0
        },
        ssr: r
      });
    });
  };
  return r ? i() : Yr(i), o;
}
function ms(e, t) {
  return /* @__PURE__ */ bt({
    name: fE(e),
    setup() {
      var n;
      const r = (n = $t(fs, null)) === null || n === void 0 ? void 0 : n.mergedIconsRef;
      return () => {
        var o;
        const i = (o = r == null ? void 0 : r.value) === null || o === void 0 ? void 0 : o[e];
        return i ? i() : t;
      };
    }
  });
}
const kE = ms("close", q("svg", {
  viewBox: "0 0 12 12",
  version: "1.1",
  xmlns: "http://www.w3.org/2000/svg",
  "aria-hidden": !0
}, q("g", {
  stroke: "none",
  "stroke-width": "1",
  fill: "none",
  "fill-rule": "evenodd"
}, q("g", {
  fill: "currentColor",
  "fill-rule": "nonzero"
}, q("path", {
  d: "M2.08859116,2.2156945 L2.14644661,2.14644661 C2.32001296,1.97288026 2.58943736,1.95359511 2.7843055,2.08859116 L2.85355339,2.14644661 L6,5.293 L9.14644661,2.14644661 C9.34170876,1.95118446 9.65829124,1.95118446 9.85355339,2.14644661 C10.0488155,2.34170876 10.0488155,2.65829124 9.85355339,2.85355339 L6.707,6 L9.85355339,9.14644661 C10.0271197,9.32001296 10.0464049,9.58943736 9.91140884,9.7843055 L9.85355339,9.85355339 C9.67998704,10.0271197 9.41056264,10.0464049 9.2156945,9.91140884 L9.14644661,9.85355339 L6,6.707 L2.85355339,9.85355339 C2.65829124,10.0488155 2.34170876,10.0488155 2.14644661,9.85355339 C1.95118446,9.65829124 1.95118446,9.34170876 2.14644661,9.14644661 L5.293,6 L2.14644661,2.85355339 C1.97288026,2.67998704 1.95359511,2.41056264 2.08859116,2.2156945 L2.14644661,2.14644661 L2.08859116,2.2156945 Z"
}))))), RE = ms("error", q("svg", {
  viewBox: "0 0 48 48",
  version: "1.1",
  xmlns: "http://www.w3.org/2000/svg"
}, q("g", {
  stroke: "none",
  "stroke-width": "1",
  "fill-rule": "evenodd"
}, q("g", {
  "fill-rule": "nonzero"
}, q("path", {
  d: "M24,4 C35.045695,4 44,12.954305 44,24 C44,35.045695 35.045695,44 24,44 C12.954305,44 4,35.045695 4,24 C4,12.954305 12.954305,4 24,4 Z M17.8838835,16.1161165 L17.7823881,16.0249942 C17.3266086,15.6583353 16.6733914,15.6583353 16.2176119,16.0249942 L16.1161165,16.1161165 L16.0249942,16.2176119 C15.6583353,16.6733914 15.6583353,17.3266086 16.0249942,17.7823881 L16.1161165,17.8838835 L22.233,24 L16.1161165,30.1161165 L16.0249942,30.2176119 C15.6583353,30.6733914 15.6583353,31.3266086 16.0249942,31.7823881 L16.1161165,31.8838835 L16.2176119,31.9750058 C16.6733914,32.3416647 17.3266086,32.3416647 17.7823881,31.9750058 L17.8838835,31.8838835 L24,25.767 L30.1161165,31.8838835 L30.2176119,31.9750058 C30.6733914,32.3416647 31.3266086,32.3416647 31.7823881,31.9750058 L31.8838835,31.8838835 L31.9750058,31.7823881 C32.3416647,31.3266086 32.3416647,30.6733914 31.9750058,30.2176119 L31.8838835,30.1161165 L25.767,24 L31.8838835,17.8838835 L31.9750058,17.7823881 C32.3416647,17.3266086 32.3416647,16.6733914 31.9750058,16.2176119 L31.8838835,16.1161165 L31.7823881,16.0249942 C31.3266086,15.6583353 30.6733914,15.6583353 30.2176119,16.0249942 L30.1161165,16.1161165 L24,22.233 L17.8838835,16.1161165 L17.7823881,16.0249942 L17.8838835,16.1161165 Z"
}))))), oh = ms("info", q("svg", {
  viewBox: "0 0 28 28",
  version: "1.1",
  xmlns: "http://www.w3.org/2000/svg"
}, q("g", {
  stroke: "none",
  "stroke-width": "1",
  "fill-rule": "evenodd"
}, q("g", {
  "fill-rule": "nonzero"
}, q("path", {
  d: "M14,2 C20.6274,2 26,7.37258 26,14 C26,20.6274 20.6274,26 14,26 C7.37258,26 2,20.6274 2,14 C2,7.37258 7.37258,2 14,2 Z M14,11 C13.4477,11 13,11.4477 13,12 L13,12 L13,20 C13,20.5523 13.4477,21 14,21 C14.5523,21 15,20.5523 15,20 L15,20 L15,12 C15,11.4477 14.5523,11 14,11 Z M14,6.75 C13.3096,6.75 12.75,7.30964 12.75,8 C12.75,8.69036 13.3096,9.25 14,9.25 C14.6904,9.25 15.25,8.69036 15.25,8 C15.25,7.30964 14.6904,6.75 14,6.75 Z"
}))))), PE = ms("success", q("svg", {
  viewBox: "0 0 48 48",
  version: "1.1",
  xmlns: "http://www.w3.org/2000/svg"
}, q("g", {
  stroke: "none",
  "stroke-width": "1",
  "fill-rule": "evenodd"
}, q("g", {
  "fill-rule": "nonzero"
}, q("path", {
  d: "M24,4 C35.045695,4 44,12.954305 44,24 C44,35.045695 35.045695,44 24,44 C12.954305,44 4,35.045695 4,24 C4,12.954305 12.954305,4 24,4 Z M32.6338835,17.6161165 C32.1782718,17.1605048 31.4584514,17.1301307 30.9676119,17.5249942 L30.8661165,17.6161165 L20.75,27.732233 L17.1338835,24.1161165 C16.6457281,23.6279612 15.8542719,23.6279612 15.3661165,24.1161165 C14.9105048,24.5717282 14.8801307,25.2915486 15.2749942,25.7823881 L15.3661165,25.8838835 L19.8661165,30.3838835 C20.3217282,30.8394952 21.0415486,30.8698693 21.5323881,30.4750058 L21.6338835,30.3838835 L32.6338835,19.3838835 C33.1220388,18.8957281 33.1220388,18.1042719 32.6338835,17.6161165 Z"
}))))), FE = ms("warning", q("svg", {
  viewBox: "0 0 24 24",
  version: "1.1",
  xmlns: "http://www.w3.org/2000/svg"
}, q("g", {
  stroke: "none",
  "stroke-width": "1",
  "fill-rule": "evenodd"
}, q("g", {
  "fill-rule": "nonzero"
}, q("path", {
  d: "M12,2 C17.523,2 22,6.478 22,12 C22,17.522 17.523,22 12,22 C6.477,22 2,17.522 2,12 C2,6.478 6.477,2 12,2 Z M12.0018002,15.0037242 C11.450254,15.0037242 11.0031376,15.4508407 11.0031376,16.0023869 C11.0031376,16.553933 11.450254,17.0010495 12.0018002,17.0010495 C12.5533463,17.0010495 13.0004628,16.553933 13.0004628,16.0023869 C13.0004628,15.4508407 12.5533463,15.0037242 12.0018002,15.0037242 Z M11.99964,7 C11.4868042,7.00018474 11.0642719,7.38637706 11.0066858,7.8837365 L11,8.00036004 L11.0018003,13.0012393 L11.00857,13.117858 C11.0665141,13.6151758 11.4893244,14.0010638 12.0021602,14.0008793 C12.514996,14.0006946 12.9375283,13.6145023 12.9951144,13.1171428 L13.0018002,13.0005193 L13,7.99964009 L12.9932303,7.8830214 C12.9352861,7.38570354 12.5124758,6.99981552 11.99964,7 Z"
}))))), Dg = /* @__PURE__ */ bt({
  name: "BaseIconSwitchTransition",
  setup(e, {
    slots: t
  }) {
    const n = Km();
    return () => q(rr, {
      name: "icon-switch-transition",
      appear: n.value
    }, t);
  }
}), BE = /* @__PURE__ */ bt({
  name: "FadeInExpandTransition",
  props: {
    appear: Boolean,
    group: Boolean,
    mode: String,
    onLeave: Function,
    onAfterLeave: Function,
    onAfterEnter: Function,
    width: Boolean,
    // reverse mode is only used in tree
    // it make it from expanded to collapsed after mounted
    reverse: Boolean
  },
  setup(e, {
    slots: t
  }) {
    function n(a) {
      e.width ? a.style.maxWidth = `${a.offsetWidth}px` : a.style.maxHeight = `${a.offsetHeight}px`, a.offsetWidth;
    }
    function r(a) {
      e.width ? a.style.maxWidth = "0" : a.style.maxHeight = "0", a.offsetWidth;
      const {
        onLeave: l
      } = e;
      l && l();
    }
    function o(a) {
      e.width ? a.style.maxWidth = "" : a.style.maxHeight = "";
      const {
        onAfterLeave: l
      } = e;
      l && l();
    }
    function i(a) {
      if (a.style.transition = "none", e.width) {
        const l = a.offsetWidth;
        a.style.maxWidth = "0", a.offsetWidth, a.style.transition = "", a.style.maxWidth = `${l}px`;
      } else if (e.reverse)
        a.style.maxHeight = `${a.offsetHeight}px`, a.offsetHeight, a.style.transition = "", a.style.maxHeight = "0";
      else {
        const l = a.offsetHeight;
        a.style.maxHeight = "0", a.offsetWidth, a.style.transition = "", a.style.maxHeight = `${l}px`;
      }
      a.offsetWidth;
    }
    function s(a) {
      var l;
      e.width ? a.style.maxWidth = "" : e.reverse || (a.style.maxHeight = ""), (l = e.onAfterEnter) === null || l === void 0 || l.call(e);
    }
    return () => {
      const {
        group: a,
        width: l,
        appear: c,
        mode: u
      } = e, d = a ? T1 : rr, f = {
        name: l ? "fade-in-width-expand-transition" : "fade-in-height-expand-transition",
        appear: c,
        onEnter: i,
        onAfterEnter: s,
        onBeforeLeave: n,
        onLeave: r,
        onAfterLeave: o
      };
      return a || (f.mode = u), q(d, f, t);
    };
  }
}), LE = Ye("base-icon", `
 height: 1em;
 width: 1em;
 line-height: 1em;
 text-align: center;
 display: inline-block;
 position: relative;
 fill: currentColor;
 transform: translateZ(0);
`, [oe("svg", `
 height: 1em;
 width: 1em;
 `)]), Mg = /* @__PURE__ */ bt({
  name: "BaseIcon",
  props: {
    role: String,
    ariaLabel: String,
    ariaDisabled: {
      type: Boolean,
      default: void 0
    },
    ariaHidden: {
      type: Boolean,
      default: void 0
    },
    clsPrefix: {
      type: String,
      required: !0
    },
    onClick: Function,
    onMousedown: Function,
    onMouseup: Function
  },
  setup(e) {
    vl("-base-icon", LE, nr(e, "clsPrefix"));
  },
  render() {
    return q("i", {
      class: `${this.clsPrefix}-base-icon`,
      onClick: this.onClick,
      onMousedown: this.onMousedown,
      onMouseup: this.onMouseup,
      role: this.role,
      "aria-label": this.ariaLabel,
      "aria-hidden": this.ariaHidden,
      "aria-disabled": this.ariaDisabled
    }, this.$slots);
  }
}), VE = Ye("base-close", `
 display: flex;
 align-items: center;
 justify-content: center;
 cursor: pointer;
 background-color: transparent;
 color: var(--n-close-icon-color);
 border-radius: var(--n-close-border-radius);
 height: var(--n-close-size);
 width: var(--n-close-size);
 font-size: var(--n-close-icon-size);
 outline: none;
 border: none;
 position: relative;
 padding: 0;
`, [Me("absolute", `
 height: var(--n-close-icon-size);
 width: var(--n-close-icon-size);
 `), oe("&::before", `
 content: "";
 position: absolute;
 width: var(--n-close-size);
 height: var(--n-close-size);
 left: 50%;
 top: 50%;
 transform: translateY(-50%) translateX(-50%);
 transition: inherit;
 border-radius: inherit;
 `), Nc("disabled", [oe("&:hover", `
 color: var(--n-close-icon-color-hover);
 `), oe("&:hover::before", `
 background-color: var(--n-close-color-hover);
 `), oe("&:focus::before", `
 background-color: var(--n-close-color-hover);
 `), oe("&:active", `
 color: var(--n-close-icon-color-pressed);
 `), oe("&:active::before", `
 background-color: var(--n-close-color-pressed);
 `)]), Me("disabled", `
 cursor: not-allowed;
 color: var(--n-close-icon-color-disabled);
 background-color: transparent;
 `), Me("round", [oe("&::before", `
 border-radius: 50%;
 `)])]), $g = /* @__PURE__ */ bt({
  name: "BaseClose",
  props: {
    isButtonTag: {
      type: Boolean,
      default: !0
    },
    clsPrefix: {
      type: String,
      required: !0
    },
    disabled: {
      type: Boolean,
      default: void 0
    },
    focusable: {
      type: Boolean,
      default: !0
    },
    round: Boolean,
    onClick: Function,
    absolute: Boolean
  },
  setup(e) {
    return vl("-base-close", VE, nr(e, "clsPrefix")), () => {
      const {
        clsPrefix: t,
        disabled: n,
        absolute: r,
        round: o,
        isButtonTag: i
      } = e;
      return q(i ? "button" : "div", {
        type: i ? "button" : void 0,
        tabindex: n || !e.focusable ? -1 : 0,
        "aria-disabled": n,
        "aria-label": "close",
        role: i ? void 0 : "button",
        disabled: n,
        class: [`${t}-base-close`, r && `${t}-base-close--absolute`, n && `${t}-base-close--disabled`, o && `${t}-base-close--round`],
        onMousedown: (a) => {
          e.focusable || a.preventDefault();
        },
        onClick: e.onClick
      }, q(Mg, {
        clsPrefix: t
      }, {
        default: () => q(kE, null)
      }));
    };
  }
}), {
  cubicBezierEaseInOut: zE
} = Wo;
function kc({
  originalTransform: e = "",
  left: t = 0,
  top: n = 0,
  transition: r = `all .3s ${zE} !important`
} = {}) {
  return [oe("&.icon-switch-transition-enter-from, &.icon-switch-transition-leave-to", {
    transform: e + " scale(0.75)",
    left: t,
    top: n,
    opacity: 0
  }), oe("&.icon-switch-transition-enter-to, &.icon-switch-transition-leave-from", {
    transform: `scale(1) ${e}`,
    left: t,
    top: n,
    opacity: 1
  }), oe("&.icon-switch-transition-enter-active, &.icon-switch-transition-leave-active", {
    transformOrigin: "center",
    position: "absolute",
    left: t,
    top: n,
    transition: r
  })];
}
const jE = oe([oe("@keyframes rotator", `
 0% {
 -webkit-transform: rotate(0deg);
 transform: rotate(0deg);
 }
 100% {
 -webkit-transform: rotate(360deg);
 transform: rotate(360deg);
 }`), Ye("base-loading", `
 position: relative;
 line-height: 0;
 width: 1em;
 height: 1em;
 `, [fe("transition-wrapper", `
 position: absolute;
 width: 100%;
 height: 100%;
 `, [kc()]), fe("placeholder", `
 position: absolute;
 left: 50%;
 top: 50%;
 transform: translateX(-50%) translateY(-50%);
 `, [kc({
  left: "50%",
  top: "50%",
  originalTransform: "translateX(-50%) translateY(-50%)"
})]), fe("container", `
 animation: rotator 3s linear infinite both;
 `, [fe("icon", `
 height: 1em;
 width: 1em;
 `)])])]), Bl = "1.6s", HE = {
  strokeWidth: {
    type: Number,
    default: 28
  },
  stroke: {
    type: String,
    default: void 0
  }
}, WE = /* @__PURE__ */ bt({
  name: "BaseLoading",
  props: Object.assign({
    clsPrefix: {
      type: String,
      required: !0
    },
    show: {
      type: Boolean,
      default: !0
    },
    scale: {
      type: Number,
      default: 1
    },
    radius: {
      type: Number,
      default: 100
    }
  }, HE),
  setup(e) {
    vl("-base-loading", jE, nr(e, "clsPrefix"));
  },
  render() {
    const {
      clsPrefix: e,
      radius: t,
      strokeWidth: n,
      stroke: r,
      scale: o
    } = this, i = t / o;
    return q("div", {
      class: `${e}-base-loading`,
      role: "img",
      "aria-label": "loading"
    }, q(Dg, null, {
      default: () => this.show ? q("div", {
        key: "icon",
        class: `${e}-base-loading__transition-wrapper`
      }, q("div", {
        class: `${e}-base-loading__container`
      }, q("svg", {
        class: `${e}-base-loading__icon`,
        viewBox: `0 0 ${2 * i} ${2 * i}`,
        xmlns: "http://www.w3.org/2000/svg",
        style: {
          color: r
        }
      }, q("g", null, q("animateTransform", {
        attributeName: "transform",
        type: "rotate",
        values: `0 ${i} ${i};270 ${i} ${i}`,
        begin: "0s",
        dur: Bl,
        fill: "freeze",
        repeatCount: "indefinite"
      }), q("circle", {
        class: `${e}-base-loading__icon`,
        fill: "none",
        stroke: "currentColor",
        "stroke-width": n,
        "stroke-linecap": "round",
        cx: i,
        cy: i,
        r: t - n / 2,
        "stroke-dasharray": 5.67 * t,
        "stroke-dashoffset": 18.48 * t
      }, q("animateTransform", {
        attributeName: "transform",
        type: "rotate",
        values: `0 ${i} ${i};135 ${i} ${i};450 ${i} ${i}`,
        begin: "0s",
        dur: Bl,
        fill: "freeze",
        repeatCount: "indefinite"
      }), q("animate", {
        attributeName: "stroke-dashoffset",
        values: `${5.67 * t};${1.42 * t};${5.67 * t}`,
        begin: "0s",
        dur: Bl,
        fill: "freeze",
        repeatCount: "indefinite"
      })))))) : q("div", {
        key: "placeholder",
        class: `${e}-base-loading__placeholder`
      }, this.$slots)
    }));
  }
}), de = {
  neutralBase: "#FFF",
  neutralInvertBase: "#000",
  neutralTextBase: "#000",
  neutralPopover: "#fff",
  neutralCard: "#fff",
  neutralModal: "#fff",
  neutralBody: "#fff",
  alpha1: "0.82",
  alpha2: "0.72",
  alpha3: "0.38",
  alpha4: "0.24",
  // disabled text, placeholder, icon
  alpha5: "0.18",
  // disabled placeholder
  alphaClose: "0.6",
  alphaDisabled: "0.5",
  alphaDisabledInput: "0.02",
  alphaPending: "0.05",
  alphaTablePending: "0.02",
  alphaPressed: "0.07",
  alphaAvatar: "0.2",
  alphaRail: "0.14",
  alphaProgressRail: ".08",
  alphaBorder: "0.12",
  alphaDivider: "0.06",
  alphaInput: "0",
  alphaAction: "0.02",
  alphaTab: "0.04",
  alphaScrollbar: "0.25",
  alphaScrollbarHover: "0.4",
  alphaCode: "0.05",
  alphaTag: "0.02",
  // primary
  primaryHover: "#36ad6a",
  primaryDefault: "#18a058",
  primaryActive: "#0c7a43",
  primarySuppl: "#36ad6a",
  // info
  infoHover: "#4098fc",
  infoDefault: "#2080f0",
  infoActive: "#1060c9",
  infoSuppl: "#4098fc",
  // error
  errorHover: "#de576d",
  errorDefault: "#d03050",
  errorActive: "#ab1f3f",
  errorSuppl: "#de576d",
  // warning
  warningHover: "#fcb040",
  warningDefault: "#f0a020",
  warningActive: "#c97c10",
  warningSuppl: "#fcb040",
  // success
  successHover: "#36ad6a",
  successDefault: "#18a058",
  successActive: "#0c7a43",
  successSuppl: "#36ad6a"
}, UE = zr(de.neutralBase), kg = zr(de.neutralInvertBase), KE = "rgba(" + kg.slice(0, 3).join(", ") + ", ";
function ih(e) {
  return KE + String(e) + ")";
}
function Ct(e) {
  const t = Array.from(kg);
  return t[3] = Number(e), Vu(UE, t);
}
const GE = Object.assign(Object.assign({
  name: "common"
}, Wo), {
  baseColor: de.neutralBase,
  // primary color
  primaryColor: de.primaryDefault,
  primaryColorHover: de.primaryHover,
  primaryColorPressed: de.primaryActive,
  primaryColorSuppl: de.primarySuppl,
  // info color
  infoColor: de.infoDefault,
  infoColorHover: de.infoHover,
  infoColorPressed: de.infoActive,
  infoColorSuppl: de.infoSuppl,
  // success color
  successColor: de.successDefault,
  successColorHover: de.successHover,
  successColorPressed: de.successActive,
  successColorSuppl: de.successSuppl,
  // warning color
  warningColor: de.warningDefault,
  warningColorHover: de.warningHover,
  warningColorPressed: de.warningActive,
  warningColorSuppl: de.warningSuppl,
  // error color
  errorColor: de.errorDefault,
  errorColorHover: de.errorHover,
  errorColorPressed: de.errorActive,
  errorColorSuppl: de.errorSuppl,
  // text color
  textColorBase: de.neutralTextBase,
  textColor1: "rgb(31, 34, 37)",
  textColor2: "rgb(51, 54, 57)",
  textColor3: "rgb(118, 124, 130)",
  // textColor4: neutral(base.alpha4), // disabled, placeholder, icon
  // textColor5: neutral(base.alpha5),
  textColorDisabled: Ct(de.alpha4),
  placeholderColor: Ct(de.alpha4),
  placeholderColorDisabled: Ct(de.alpha5),
  iconColor: Ct(de.alpha4),
  iconColorHover: $s(Ct(de.alpha4), {
    lightness: 0.75
  }),
  iconColorPressed: $s(Ct(de.alpha4), {
    lightness: 0.9
  }),
  iconColorDisabled: Ct(de.alpha5),
  opacity1: de.alpha1,
  opacity2: de.alpha2,
  opacity3: de.alpha3,
  opacity4: de.alpha4,
  opacity5: de.alpha5,
  dividerColor: "rgb(239, 239, 245)",
  borderColor: "rgb(224, 224, 230)",
  // close
  closeIconColor: Ct(Number(de.alphaClose)),
  closeIconColorHover: Ct(Number(de.alphaClose)),
  closeIconColorPressed: Ct(Number(de.alphaClose)),
  closeColorHover: "rgba(0, 0, 0, .09)",
  closeColorPressed: "rgba(0, 0, 0, .13)",
  // clear
  clearColor: Ct(de.alpha4),
  clearColorHover: $s(Ct(de.alpha4), {
    lightness: 0.75
  }),
  clearColorPressed: $s(Ct(de.alpha4), {
    lightness: 0.9
  }),
  scrollbarColor: ih(de.alphaScrollbar),
  scrollbarColorHover: ih(de.alphaScrollbarHover),
  scrollbarWidth: "5px",
  scrollbarHeight: "5px",
  scrollbarBorderRadius: "5px",
  progressRailColor: Ct(de.alphaProgressRail),
  railColor: "rgb(219, 219, 223)",
  popoverColor: de.neutralPopover,
  tableColor: de.neutralCard,
  cardColor: de.neutralCard,
  modalColor: de.neutralModal,
  bodyColor: de.neutralBody,
  tagColor: "#eee",
  avatarColor: Ct(de.alphaAvatar),
  invertedColor: "rgb(0, 20, 40)",
  inputColor: Ct(de.alphaInput),
  codeColor: "rgb(244, 244, 248)",
  tabColor: "rgb(247, 247, 250)",
  actionColor: "rgb(250, 250, 252)",
  tableHeaderColor: "rgb(250, 250, 252)",
  hoverColor: "rgb(243, 243, 245)",
  // use color with alpha since it can be nested with header filter & sorter effect
  tableColorHover: "rgba(0, 0, 100, 0.03)",
  tableColorStriped: "rgba(0, 0, 100, 0.02)",
  pressedColor: "rgb(237, 237, 239)",
  opacityDisabled: de.alphaDisabled,
  inputColorDisabled: "rgb(250, 250, 252)",
  // secondary button color
  // can also be used in tertiary button & quaternary button
  buttonColor2: "rgba(46, 51, 56, .05)",
  buttonColor2Hover: "rgba(46, 51, 56, .09)",
  buttonColor2Pressed: "rgba(46, 51, 56, .13)",
  boxShadow1: "0 1px 2px -2px rgba(0, 0, 0, .08), 0 3px 6px 0 rgba(0, 0, 0, .06), 0 5px 12px 4px rgba(0, 0, 0, .04)",
  boxShadow2: "0 3px 6px -4px rgba(0, 0, 0, .12), 0 6px 16px 0 rgba(0, 0, 0, .08), 0 9px 28px 8px rgba(0, 0, 0, .05)",
  boxShadow3: "0 6px 16px -9px rgba(0, 0, 0, .08), 0 9px 28px 0 rgba(0, 0, 0, .05), 0 12px 48px 16px rgba(0, 0, 0, .03)"
}), gs = GE, YE = (e) => {
  const {
    scrollbarColor: t,
    scrollbarColorHover: n
  } = e;
  return {
    color: t,
    colorHover: n
  };
}, qE = {
  name: "Scrollbar",
  common: gs,
  self: YE
}, Rg = qE, {
  cubicBezierEaseInOut: sh
} = Wo;
function Pg({
  name: e = "fade-in",
  enterDuration: t = "0.2s",
  leaveDuration: n = "0.2s",
  enterCubicBezier: r = sh,
  leaveCubicBezier: o = sh
} = {}) {
  return [oe(`&.${e}-transition-enter-active`, {
    transition: `all ${t} ${r}!important`
  }), oe(`&.${e}-transition-leave-active`, {
    transition: `all ${n} ${o}!important`
  }), oe(`&.${e}-transition-enter-from, &.${e}-transition-leave-to`, {
    opacity: 0
  }), oe(`&.${e}-transition-leave-from, &.${e}-transition-enter-to`, {
    opacity: 1
  })];
}
const ZE = Ye("scrollbar", `
 overflow: hidden;
 position: relative;
 z-index: auto;
 height: 100%;
 width: 100%;
`, [oe(">", [Ye("scrollbar-container", `
 width: 100%;
 overflow: scroll;
 height: 100%;
 min-height: inherit;
 max-height: inherit;
 scrollbar-width: none;
 `, [oe("&::-webkit-scrollbar, &::-webkit-scrollbar-track-piece, &::-webkit-scrollbar-thumb", `
 width: 0;
 height: 0;
 display: none;
 `), oe(">", [Ye("scrollbar-content", `
 box-sizing: border-box;
 min-width: 100%;
 `)])])]), oe(">, +", [Ye("scrollbar-rail", `
 position: absolute;
 pointer-events: none;
 user-select: none;
 -webkit-user-select: none;
 `, [Me("horizontal", `
 left: 2px;
 right: 2px;
 bottom: 4px;
 height: var(--n-scrollbar-height);
 `, [oe(">", [fe("scrollbar", `
 height: var(--n-scrollbar-height);
 border-radius: var(--n-scrollbar-border-radius);
 right: 0;
 `)])]), Me("vertical", `
 right: 4px;
 top: 2px;
 bottom: 2px;
 width: var(--n-scrollbar-width);
 `, [oe(">", [fe("scrollbar", `
 width: var(--n-scrollbar-width);
 border-radius: var(--n-scrollbar-border-radius);
 bottom: 0;
 `)])]), Me("disabled", [oe(">", [fe("scrollbar", "pointer-events: none;")])]), oe(">", [fe("scrollbar", `
 z-index: 1;
 position: absolute;
 cursor: pointer;
 pointer-events: all;
 background-color: var(--n-scrollbar-color);
 transition: background-color .2s var(--n-scrollbar-bezier);
 `, [Pg(), oe("&:hover", "background-color: var(--n-scrollbar-color-hover);")])])])])]), XE = Object.assign(Object.assign({}, tn.props), {
  size: {
    type: Number,
    default: 5
  },
  duration: {
    type: Number,
    default: 0
  },
  scrollable: {
    type: Boolean,
    default: !0
  },
  xScrollable: Boolean,
  trigger: {
    type: String,
    default: "hover"
  },
  useUnifiedContainer: Boolean,
  triggerDisplayManually: Boolean,
  // If container is set, resize observer won't not attached
  container: Function,
  content: Function,
  containerClass: String,
  containerStyle: [String, Object],
  contentClass: [String, Array],
  contentStyle: [String, Object],
  horizontalRailStyle: [String, Object],
  verticalRailStyle: [String, Object],
  onScroll: Function,
  onWheel: Function,
  onResize: Function,
  internalOnUpdateScrollLeft: Function,
  internalHoistYRail: Boolean
}), JE = /* @__PURE__ */ bt({
  name: "Scrollbar",
  props: XE,
  inheritAttrs: !1,
  setup(e) {
    const {
      mergedClsPrefixRef: t,
      inlineThemeDisabled: n,
      mergedRtlRef: r
    } = hs(e), o = yl("Scrollbar", r, t), i = Ee(null), s = Ee(null), a = Ee(null), l = Ee(null), c = Ee(null), u = Ee(null), d = Ee(null), f = Ee(null), m = Ee(null), h = Ee(null), p = Ee(null), g = Ee(0), v = Ee(0), y = Ee(!1), b = Ee(!1);
    let E = !1, S = !1, T, C, _ = 0, w = 0, R = 0, O = 0;
    const I = $C(), L = Te(() => {
      const {
        value: Y
      } = f, {
        value: se
      } = u, {
        value: ye
      } = h;
      return Y === null || se === null || ye === null ? 0 : Math.min(Y, ye * Y / se + e.size * 1.5);
    }), D = Te(() => `${L.value}px`), P = Te(() => {
      const {
        value: Y
      } = m, {
        value: se
      } = d, {
        value: ye
      } = p;
      return Y === null || se === null || ye === null ? 0 : ye * Y / se + e.size * 1.5;
    }), k = Te(() => `${P.value}px`), N = Te(() => {
      const {
        value: Y
      } = f, {
        value: se
      } = g, {
        value: ye
      } = u, {
        value: We
      } = h;
      if (Y === null || ye === null || We === null)
        return 0;
      {
        const at = ye - Y;
        return at ? se / at * (We - L.value) : 0;
      }
    }), $ = Te(() => `${N.value}px`), B = Te(() => {
      const {
        value: Y
      } = m, {
        value: se
      } = v, {
        value: ye
      } = d, {
        value: We
      } = p;
      if (Y === null || ye === null || We === null)
        return 0;
      {
        const at = ye - Y;
        return at ? se / at * (We - P.value) : 0;
      }
    }), U = Te(() => `${B.value}px`), J = Te(() => {
      const {
        value: Y
      } = f, {
        value: se
      } = u;
      return Y !== null && se !== null && se > Y;
    }), te = Te(() => {
      const {
        value: Y
      } = m, {
        value: se
      } = d;
      return Y !== null && se !== null && se > Y;
    }), ie = Te(() => {
      const {
        trigger: Y
      } = e;
      return Y === "none" || y.value;
    }), z = Te(() => {
      const {
        trigger: Y
      } = e;
      return Y === "none" || b.value;
    }), le = Te(() => {
      const {
        container: Y
      } = e;
      return Y ? Y() : s.value;
    }), j = Te(() => {
      const {
        content: Y
      } = e;
      return Y ? Y() : a.value;
    }), pe = bw(() => {
      e.container || we({
        top: g.value,
        left: v.value
      });
    }), ne = () => {
      pe.isDeactivated || re();
    }, ee = (Y) => {
      if (pe.isDeactivated)
        return;
      const {
        onResize: se
      } = e;
      se && se(Y), re();
    }, we = (Y, se) => {
      if (!e.scrollable)
        return;
      if (typeof Y == "number") {
        De(se ?? 0, Y, 0, !1, "auto");
        return;
      }
      const {
        left: ye,
        top: We,
        index: at,
        elSize: Rt,
        position: pn,
        behavior: nt,
        el: mn,
        debounce: Zo = !0
      } = Y;
      (ye !== void 0 || We !== void 0) && De(ye ?? 0, We ?? 0, 0, !1, nt), mn !== void 0 ? De(0, mn.offsetTop, mn.offsetHeight, Zo, nt) : at !== void 0 && Rt !== void 0 ? De(0, at * Rt, Rt, Zo, nt) : pn === "bottom" ? De(0, Number.MAX_SAFE_INTEGER, 0, !1, nt) : pn === "top" && De(0, 0, 0, !1, nt);
    }, me = (Y, se) => {
      if (!e.scrollable)
        return;
      const {
        value: ye
      } = le;
      ye && (typeof Y == "object" ? ye.scrollBy(Y) : ye.scrollBy(Y, se || 0));
    };
    function De(Y, se, ye, We, at) {
      const {
        value: Rt
      } = le;
      if (Rt) {
        if (We) {
          const {
            scrollTop: pn,
            offsetHeight: nt
          } = Rt;
          if (se > pn) {
            se + ye <= pn + nt || Rt.scrollTo({
              left: Y,
              top: se + ye - nt,
              behavior: at
            });
            return;
          }
        }
        Rt.scrollTo({
          left: Y,
          top: se,
          behavior: at
        });
      }
    }
    function x() {
      X(), Q(), re();
    }
    function A() {
      F();
    }
    function F() {
      H(), W();
    }
    function H() {
      C !== void 0 && window.clearTimeout(C), C = window.setTimeout(() => {
        b.value = !1;
      }, e.duration);
    }
    function W() {
      T !== void 0 && window.clearTimeout(T), T = window.setTimeout(() => {
        y.value = !1;
      }, e.duration);
    }
    function X() {
      T !== void 0 && window.clearTimeout(T), y.value = !0;
    }
    function Q() {
      C !== void 0 && window.clearTimeout(C), b.value = !0;
    }
    function V(Y) {
      const {
        onScroll: se
      } = e;
      se && se(Y), G();
    }
    function G() {
      const {
        value: Y
      } = le;
      Y && (g.value = Y.scrollTop, v.value = Y.scrollLeft * (o != null && o.value ? -1 : 1));
    }
    function K() {
      const {
        value: Y
      } = j;
      Y && (u.value = Y.offsetHeight, d.value = Y.offsetWidth);
      const {
        value: se
      } = le;
      se && (f.value = se.offsetHeight, m.value = se.offsetWidth);
      const {
        value: ye
      } = c, {
        value: We
      } = l;
      ye && (p.value = ye.offsetWidth), We && (h.value = We.offsetHeight);
    }
    function ce() {
      const {
        value: Y
      } = le;
      Y && (g.value = Y.scrollTop, v.value = Y.scrollLeft * (o != null && o.value ? -1 : 1), f.value = Y.offsetHeight, m.value = Y.offsetWidth, u.value = Y.scrollHeight, d.value = Y.scrollWidth);
      const {
        value: se
      } = c, {
        value: ye
      } = l;
      se && (p.value = se.offsetWidth), ye && (h.value = ye.offsetHeight);
    }
    function re() {
      e.scrollable && (e.useUnifiedContainer ? ce() : (K(), G()));
    }
    function ue(Y) {
      var se;
      return !(!((se = i.value) === null || se === void 0) && se.contains(Lu(Y)));
    }
    function xe(Y) {
      Y.preventDefault(), Y.stopPropagation(), S = !0, Wt("mousemove", window, Ie, !0), Wt("mouseup", window, Pe, !0), w = v.value, R = o != null && o.value ? window.innerWidth - Y.clientX : Y.clientX;
    }
    function Ie(Y) {
      if (!S)
        return;
      T !== void 0 && window.clearTimeout(T), C !== void 0 && window.clearTimeout(C);
      const {
        value: se
      } = m, {
        value: ye
      } = d, {
        value: We
      } = P;
      if (se === null || ye === null)
        return;
      const Rt = (o != null && o.value ? window.innerWidth - Y.clientX - R : Y.clientX - R) * (ye - se) / (se - We), pn = ye - se;
      let nt = w + Rt;
      nt = Math.min(pn, nt), nt = Math.max(nt, 0);
      const {
        value: mn
      } = le;
      if (mn) {
        mn.scrollLeft = nt * (o != null && o.value ? -1 : 1);
        const {
          internalOnUpdateScrollLeft: Zo
        } = e;
        Zo && Zo(nt);
      }
    }
    function Pe(Y) {
      Y.preventDefault(), Y.stopPropagation(), Ot("mousemove", window, Ie, !0), Ot("mouseup", window, Pe, !0), S = !1, re(), ue(Y) && F();
    }
    function Fe(Y) {
      Y.preventDefault(), Y.stopPropagation(), E = !0, Wt("mousemove", window, Xe, !0), Wt("mouseup", window, It, !0), _ = g.value, O = Y.clientY;
    }
    function Xe(Y) {
      if (!E)
        return;
      T !== void 0 && window.clearTimeout(T), C !== void 0 && window.clearTimeout(C);
      const {
        value: se
      } = f, {
        value: ye
      } = u, {
        value: We
      } = L;
      if (se === null || ye === null)
        return;
      const Rt = (Y.clientY - O) * (ye - se) / (se - We), pn = ye - se;
      let nt = _ + Rt;
      nt = Math.min(pn, nt), nt = Math.max(nt, 0);
      const {
        value: mn
      } = le;
      mn && (mn.scrollTop = nt);
    }
    function It(Y) {
      Y.preventDefault(), Y.stopPropagation(), Ot("mousemove", window, Xe, !0), Ot("mouseup", window, It, !0), E = !1, re(), ue(Y) && F();
    }
    il(() => {
      const {
        value: Y
      } = te, {
        value: se
      } = J, {
        value: ye
      } = t, {
        value: We
      } = c, {
        value: at
      } = l;
      We && (Y ? We.classList.remove(`${ye}-scrollbar-rail--disabled`) : We.classList.add(`${ye}-scrollbar-rail--disabled`)), at && (se ? at.classList.remove(`${ye}-scrollbar-rail--disabled`) : at.classList.add(`${ye}-scrollbar-rail--disabled`));
    }), lr(() => {
      e.container || re();
    }), nn(() => {
      T !== void 0 && window.clearTimeout(T), C !== void 0 && window.clearTimeout(C), Ot("mousemove", window, Xe, !0), Ot("mouseup", window, It, !0);
    });
    const kn = tn("Scrollbar", "-scrollbar", ZE, Rg, e, t), qo = Te(() => {
      const {
        common: {
          cubicBezierEaseInOut: Y,
          scrollbarBorderRadius: se,
          scrollbarHeight: ye,
          scrollbarWidth: We
        },
        self: {
          color: at,
          colorHover: Rt
        }
      } = kn.value;
      return {
        "--n-scrollbar-bezier": Y,
        "--n-scrollbar-color": at,
        "--n-scrollbar-color-hover": Rt,
        "--n-scrollbar-border-radius": se,
        "--n-scrollbar-width": We,
        "--n-scrollbar-height": ye
      };
    }), zt = n ? ps("scrollbar", void 0, qo, e) : void 0;
    return Object.assign(Object.assign({}, {
      scrollTo: we,
      scrollBy: me,
      sync: re,
      syncUnifiedContainer: ce,
      handleMouseEnterWrapper: x,
      handleMouseLeaveWrapper: A
    }), {
      mergedClsPrefix: t,
      rtlEnabled: o,
      containerScrollTop: g,
      wrapperRef: i,
      containerRef: s,
      contentRef: a,
      yRailRef: l,
      xRailRef: c,
      needYBar: J,
      needXBar: te,
      yBarSizePx: D,
      xBarSizePx: k,
      yBarTopPx: $,
      xBarLeftPx: U,
      isShowXBar: ie,
      isShowYBar: z,
      isIos: I,
      handleScroll: V,
      handleContentResize: ne,
      handleContainerResize: ee,
      handleYScrollMouseDown: Fe,
      handleXScrollMouseDown: xe,
      cssVars: n ? void 0 : qo,
      themeClass: zt == null ? void 0 : zt.themeClass,
      onRender: zt == null ? void 0 : zt.onRender
    });
  },
  render() {
    var e;
    const {
      $slots: t,
      mergedClsPrefix: n,
      triggerDisplayManually: r,
      rtlEnabled: o,
      internalHoistYRail: i
    } = this;
    if (!this.scrollable)
      return (e = t.default) === null || e === void 0 ? void 0 : e.call(t);
    const s = this.trigger === "none", a = (u, d) => q("div", {
      ref: "yRailRef",
      class: [`${n}-scrollbar-rail`, `${n}-scrollbar-rail--vertical`, u],
      "data-scrollbar-rail": !0,
      style: [d || "", this.verticalRailStyle],
      "aria-hiddens": !0
    }, q(
      // eslint-disable-next-line @typescript-eslint/no-unsafe-argument
      s ? df : rr,
      s ? null : {
        name: "fade-in-transition"
      },
      {
        default: () => this.needYBar && this.isShowYBar && !this.isIos ? q("div", {
          class: `${n}-scrollbar-rail__scrollbar`,
          style: {
            height: this.yBarSizePx,
            top: this.yBarTopPx
          },
          onMousedown: this.handleYScrollMouseDown
        }) : null
      }
    )), l = () => {
      var u, d;
      return (u = this.onRender) === null || u === void 0 || u.call(this), q("div", Pu(this.$attrs, {
        role: "none",
        ref: "wrapperRef",
        class: [`${n}-scrollbar`, this.themeClass, o && `${n}-scrollbar--rtl`],
        style: this.cssVars,
        onMouseenter: r ? void 0 : this.handleMouseEnterWrapper,
        onMouseleave: r ? void 0 : this.handleMouseLeaveWrapper
      }), [this.container ? (d = t.default) === null || d === void 0 ? void 0 : d.call(t) : q("div", {
        role: "none",
        ref: "containerRef",
        class: [`${n}-scrollbar-container`, this.containerClass],
        style: this.containerStyle,
        onScroll: this.handleScroll,
        onWheel: this.onWheel
      }, q(kf, {
        onResize: this.handleContentResize
      }, {
        default: () => q("div", {
          ref: "contentRef",
          role: "none",
          style: [{
            width: this.xScrollable ? "fit-content" : null
          }, this.contentStyle],
          class: [`${n}-scrollbar-content`, this.contentClass]
        }, t)
      })), i ? null : a(void 0, void 0), this.xScrollable && q("div", {
        ref: "xRailRef",
        class: [`${n}-scrollbar-rail`, `${n}-scrollbar-rail--horizontal`],
        style: this.horizontalRailStyle,
        "data-scrollbar-rail": !0,
        "aria-hidden": !0
      }, q(
        // eslint-disable-next-line @typescript-eslint/no-unsafe-argument
        s ? df : rr,
        s ? null : {
          name: "fade-in-transition"
        },
        {
          default: () => this.needXBar && this.isShowXBar && !this.isIos ? q("div", {
            class: `${n}-scrollbar-rail__scrollbar`,
            style: {
              width: this.xBarSizePx,
              right: o ? this.xBarLeftPx : void 0,
              left: o ? void 0 : this.xBarLeftPx
            },
            onMousedown: this.handleXScrollMouseDown
          }) : null
        }
      ))]);
    }, c = this.container ? l() : q(kf, {
      onResize: this.handleContainerResize
    }, {
      default: l
    });
    return i ? q(dt, null, c, a(this.themeClass, this.cssVars)) : c;
  }
}), QE = JE, {
  cubicBezierEaseIn: ah,
  cubicBezierEaseOut: lh
} = Wo;
function e_({
  transformOrigin: e = "inherit",
  duration: t = ".2s",
  enterScale: n = ".9",
  originalTransform: r = "",
  originalTransition: o = ""
} = {}) {
  return [oe("&.fade-in-scale-up-transition-leave-active", {
    transformOrigin: e,
    transition: `opacity ${t} ${ah}, transform ${t} ${ah} ${o && "," + o}`
  }), oe("&.fade-in-scale-up-transition-enter-active", {
    transformOrigin: e,
    transition: `opacity ${t} ${lh}, transform ${t} ${lh} ${o && "," + o}`
  }), oe("&.fade-in-scale-up-transition-enter-from, &.fade-in-scale-up-transition-leave-to", {
    opacity: 0,
    transform: `${r} scale(${n})`
  }), oe("&.fade-in-scale-up-transition-leave-from, &.fade-in-scale-up-transition-enter-to", {
    opacity: 1,
    transform: `${r} scale(1)`
  })];
}
const t_ = Ye("base-wave", `
 position: absolute;
 left: 0;
 right: 0;
 top: 0;
 bottom: 0;
 border-radius: inherit;
`), n_ = /* @__PURE__ */ bt({
  name: "BaseWave",
  props: {
    clsPrefix: {
      type: String,
      required: !0
    }
  },
  setup(e) {
    vl("-base-wave", t_, nr(e, "clsPrefix"));
    const t = Ee(null), n = Ee(!1);
    let r = null;
    return nn(() => {
      r !== null && window.clearTimeout(r);
    }), {
      active: n,
      selfRef: t,
      play() {
        r !== null && (window.clearTimeout(r), n.value = !1, r = null), Li(() => {
          var o;
          (o = t.value) === null || o === void 0 || o.offsetHeight, n.value = !0, r = window.setTimeout(() => {
            n.value = !1, r = null;
          }, 1e3);
        });
      }
    };
  },
  render() {
    const {
      clsPrefix: e
    } = this;
    return q("div", {
      ref: "selfRef",
      "aria-hidden": !0,
      class: [`${e}-base-wave`, this.active && `${e}-base-wave--active`]
    });
  }
}), {
  cubicBezierEaseInOut: Fn
} = Wo;
function r_({
  duration: e = ".2s",
  delay: t = ".1s"
} = {}) {
  return [oe("&.fade-in-width-expand-transition-leave-from, &.fade-in-width-expand-transition-enter-to", {
    opacity: 1
  }), oe("&.fade-in-width-expand-transition-leave-to, &.fade-in-width-expand-transition-enter-from", `
 opacity: 0!important;
 margin-left: 0!important;
 margin-right: 0!important;
 `), oe("&.fade-in-width-expand-transition-leave-active", `
 overflow: hidden;
 transition:
 opacity ${e} ${Fn},
 max-width ${e} ${Fn} ${t},
 margin-left ${e} ${Fn} ${t},
 margin-right ${e} ${Fn} ${t};
 `), oe("&.fade-in-width-expand-transition-enter-active", `
 overflow: hidden;
 transition:
 opacity ${e} ${Fn} ${t},
 max-width ${e} ${Fn},
 margin-left ${e} ${Fn},
 margin-right ${e} ${Fn};
 `)];
}
const o_ = us && "chrome" in window;
us && navigator.userAgent.includes("Firefox");
const i_ = us && navigator.userAgent.includes("Safari") && !o_;
function fr(e) {
  return Vu(e, [255, 255, 255, 0.16]);
}
function js(e) {
  return Vu(e, [0, 0, 0, 0.12]);
}
const s_ = "n-button-group", a_ = {
  paddingTiny: "0 6px",
  paddingSmall: "0 10px",
  paddingMedium: "0 14px",
  paddingLarge: "0 18px",
  paddingRoundTiny: "0 10px",
  paddingRoundSmall: "0 14px",
  paddingRoundMedium: "0 18px",
  paddingRoundLarge: "0 22px",
  iconMarginTiny: "6px",
  iconMarginSmall: "6px",
  iconMarginMedium: "6px",
  iconMarginLarge: "6px",
  iconSizeTiny: "14px",
  iconSizeSmall: "18px",
  iconSizeMedium: "18px",
  iconSizeLarge: "20px",
  rippleDuration: ".6s"
}, l_ = (e) => {
  const {
    heightTiny: t,
    heightSmall: n,
    heightMedium: r,
    heightLarge: o,
    borderRadius: i,
    fontSizeTiny: s,
    fontSizeSmall: a,
    fontSizeMedium: l,
    fontSizeLarge: c,
    opacityDisabled: u,
    textColor2: d,
    textColor3: f,
    primaryColorHover: m,
    primaryColorPressed: h,
    borderColor: p,
    primaryColor: g,
    baseColor: v,
    infoColor: y,
    infoColorHover: b,
    infoColorPressed: E,
    successColor: S,
    successColorHover: T,
    successColorPressed: C,
    warningColor: _,
    warningColorHover: w,
    warningColorPressed: R,
    errorColor: O,
    errorColorHover: I,
    errorColorPressed: L,
    fontWeight: D,
    buttonColor2: P,
    buttonColor2Hover: k,
    buttonColor2Pressed: N,
    fontWeightStrong: $
  } = e;
  return Object.assign(Object.assign({}, a_), {
    heightTiny: t,
    heightSmall: n,
    heightMedium: r,
    heightLarge: o,
    borderRadiusTiny: i,
    borderRadiusSmall: i,
    borderRadiusMedium: i,
    borderRadiusLarge: i,
    fontSizeTiny: s,
    fontSizeSmall: a,
    fontSizeMedium: l,
    fontSizeLarge: c,
    opacityDisabled: u,
    // secondary
    colorOpacitySecondary: "0.16",
    colorOpacitySecondaryHover: "0.22",
    colorOpacitySecondaryPressed: "0.28",
    colorSecondary: P,
    colorSecondaryHover: k,
    colorSecondaryPressed: N,
    // tertiary
    colorTertiary: P,
    colorTertiaryHover: k,
    colorTertiaryPressed: N,
    // quaternary
    colorQuaternary: "#0000",
    colorQuaternaryHover: k,
    colorQuaternaryPressed: N,
    // default type
    color: "#0000",
    colorHover: "#0000",
    colorPressed: "#0000",
    colorFocus: "#0000",
    colorDisabled: "#0000",
    textColor: d,
    textColorTertiary: f,
    textColorHover: m,
    textColorPressed: h,
    textColorFocus: m,
    textColorDisabled: d,
    textColorText: d,
    textColorTextHover: m,
    textColorTextPressed: h,
    textColorTextFocus: m,
    textColorTextDisabled: d,
    textColorGhost: d,
    textColorGhostHover: m,
    textColorGhostPressed: h,
    textColorGhostFocus: m,
    textColorGhostDisabled: d,
    border: `1px solid ${p}`,
    borderHover: `1px solid ${m}`,
    borderPressed: `1px solid ${h}`,
    borderFocus: `1px solid ${m}`,
    borderDisabled: `1px solid ${p}`,
    rippleColor: g,
    // primary
    colorPrimary: g,
    colorHoverPrimary: m,
    colorPressedPrimary: h,
    colorFocusPrimary: m,
    colorDisabledPrimary: g,
    textColorPrimary: v,
    textColorHoverPrimary: v,
    textColorPressedPrimary: v,
    textColorFocusPrimary: v,
    textColorDisabledPrimary: v,
    textColorTextPrimary: g,
    textColorTextHoverPrimary: m,
    textColorTextPressedPrimary: h,
    textColorTextFocusPrimary: m,
    textColorTextDisabledPrimary: d,
    textColorGhostPrimary: g,
    textColorGhostHoverPrimary: m,
    textColorGhostPressedPrimary: h,
    textColorGhostFocusPrimary: m,
    textColorGhostDisabledPrimary: g,
    borderPrimary: `1px solid ${g}`,
    borderHoverPrimary: `1px solid ${m}`,
    borderPressedPrimary: `1px solid ${h}`,
    borderFocusPrimary: `1px solid ${m}`,
    borderDisabledPrimary: `1px solid ${g}`,
    rippleColorPrimary: g,
    // info
    colorInfo: y,
    colorHoverInfo: b,
    colorPressedInfo: E,
    colorFocusInfo: b,
    colorDisabledInfo: y,
    textColorInfo: v,
    textColorHoverInfo: v,
    textColorPressedInfo: v,
    textColorFocusInfo: v,
    textColorDisabledInfo: v,
    textColorTextInfo: y,
    textColorTextHoverInfo: b,
    textColorTextPressedInfo: E,
    textColorTextFocusInfo: b,
    textColorTextDisabledInfo: d,
    textColorGhostInfo: y,
    textColorGhostHoverInfo: b,
    textColorGhostPressedInfo: E,
    textColorGhostFocusInfo: b,
    textColorGhostDisabledInfo: y,
    borderInfo: `1px solid ${y}`,
    borderHoverInfo: `1px solid ${b}`,
    borderPressedInfo: `1px solid ${E}`,
    borderFocusInfo: `1px solid ${b}`,
    borderDisabledInfo: `1px solid ${y}`,
    rippleColorInfo: y,
    // success
    colorSuccess: S,
    colorHoverSuccess: T,
    colorPressedSuccess: C,
    colorFocusSuccess: T,
    colorDisabledSuccess: S,
    textColorSuccess: v,
    textColorHoverSuccess: v,
    textColorPressedSuccess: v,
    textColorFocusSuccess: v,
    textColorDisabledSuccess: v,
    textColorTextSuccess: S,
    textColorTextHoverSuccess: T,
    textColorTextPressedSuccess: C,
    textColorTextFocusSuccess: T,
    textColorTextDisabledSuccess: d,
    textColorGhostSuccess: S,
    textColorGhostHoverSuccess: T,
    textColorGhostPressedSuccess: C,
    textColorGhostFocusSuccess: T,
    textColorGhostDisabledSuccess: S,
    borderSuccess: `1px solid ${S}`,
    borderHoverSuccess: `1px solid ${T}`,
    borderPressedSuccess: `1px solid ${C}`,
    borderFocusSuccess: `1px solid ${T}`,
    borderDisabledSuccess: `1px solid ${S}`,
    rippleColorSuccess: S,
    // warning
    colorWarning: _,
    colorHoverWarning: w,
    colorPressedWarning: R,
    colorFocusWarning: w,
    colorDisabledWarning: _,
    textColorWarning: v,
    textColorHoverWarning: v,
    textColorPressedWarning: v,
    textColorFocusWarning: v,
    textColorDisabledWarning: v,
    textColorTextWarning: _,
    textColorTextHoverWarning: w,
    textColorTextPressedWarning: R,
    textColorTextFocusWarning: w,
    textColorTextDisabledWarning: d,
    textColorGhostWarning: _,
    textColorGhostHoverWarning: w,
    textColorGhostPressedWarning: R,
    textColorGhostFocusWarning: w,
    textColorGhostDisabledWarning: _,
    borderWarning: `1px solid ${_}`,
    borderHoverWarning: `1px solid ${w}`,
    borderPressedWarning: `1px solid ${R}`,
    borderFocusWarning: `1px solid ${w}`,
    borderDisabledWarning: `1px solid ${_}`,
    rippleColorWarning: _,
    // error
    colorError: O,
    colorHoverError: I,
    colorPressedError: L,
    colorFocusError: I,
    colorDisabledError: O,
    textColorError: v,
    textColorHoverError: v,
    textColorPressedError: v,
    textColorFocusError: v,
    textColorDisabledError: v,
    textColorTextError: O,
    textColorTextHoverError: I,
    textColorTextPressedError: L,
    textColorTextFocusError: I,
    textColorTextDisabledError: d,
    textColorGhostError: O,
    textColorGhostHoverError: I,
    textColorGhostPressedError: L,
    textColorGhostFocusError: I,
    textColorGhostDisabledError: O,
    borderError: `1px solid ${O}`,
    borderHoverError: `1px solid ${I}`,
    borderPressedError: `1px solid ${L}`,
    borderFocusError: `1px solid ${I}`,
    borderDisabledError: `1px solid ${O}`,
    rippleColorError: O,
    waveOpacity: "0.6",
    fontWeight: D,
    fontWeightStrong: $
  });
}, c_ = {
  name: "Button",
  common: gs,
  self: l_
}, Fg = c_, u_ = oe([Ye("button", `
 margin: 0;
 font-weight: var(--n-font-weight);
 line-height: 1;
 font-family: inherit;
 padding: var(--n-padding);
 height: var(--n-height);
 font-size: var(--n-font-size);
 border-radius: var(--n-border-radius);
 color: var(--n-text-color);
 background-color: var(--n-color);
 width: var(--n-width);
 white-space: nowrap;
 outline: none;
 position: relative;
 z-index: auto;
 border: none;
 display: inline-flex;
 flex-wrap: nowrap;
 flex-shrink: 0;
 align-items: center;
 justify-content: center;
 user-select: none;
 -webkit-user-select: none;
 text-align: center;
 cursor: pointer;
 text-decoration: none;
 transition:
 color .3s var(--n-bezier),
 background-color .3s var(--n-bezier),
 opacity .3s var(--n-bezier),
 border-color .3s var(--n-bezier);
 `, [Me("color", [fe("border", {
  borderColor: "var(--n-border-color)"
}), Me("disabled", [fe("border", {
  borderColor: "var(--n-border-color-disabled)"
})]), Nc("disabled", [oe("&:focus", [fe("state-border", {
  borderColor: "var(--n-border-color-focus)"
})]), oe("&:hover", [fe("state-border", {
  borderColor: "var(--n-border-color-hover)"
})]), oe("&:active", [fe("state-border", {
  borderColor: "var(--n-border-color-pressed)"
})]), Me("pressed", [fe("state-border", {
  borderColor: "var(--n-border-color-pressed)"
})])])]), Me("disabled", {
  backgroundColor: "var(--n-color-disabled)",
  color: "var(--n-text-color-disabled)"
}, [fe("border", {
  border: "var(--n-border-disabled)"
})]), Nc("disabled", [oe("&:focus", {
  backgroundColor: "var(--n-color-focus)",
  color: "var(--n-text-color-focus)"
}, [fe("state-border", {
  border: "var(--n-border-focus)"
})]), oe("&:hover", {
  backgroundColor: "var(--n-color-hover)",
  color: "var(--n-text-color-hover)"
}, [fe("state-border", {
  border: "var(--n-border-hover)"
})]), oe("&:active", {
  backgroundColor: "var(--n-color-pressed)",
  color: "var(--n-text-color-pressed)"
}, [fe("state-border", {
  border: "var(--n-border-pressed)"
})]), Me("pressed", {
  backgroundColor: "var(--n-color-pressed)",
  color: "var(--n-text-color-pressed)"
}, [fe("state-border", {
  border: "var(--n-border-pressed)"
})])]), Me("loading", "cursor: wait;"), Ye("base-wave", `
 pointer-events: none;
 top: 0;
 right: 0;
 bottom: 0;
 left: 0;
 animation-iteration-count: 1;
 animation-duration: var(--n-ripple-duration);
 animation-timing-function: var(--n-bezier-ease-out), var(--n-bezier-ease-out);
 `, [Me("active", {
  zIndex: 1,
  animationName: "button-wave-spread, button-wave-opacity"
})]), us && "MozBoxSizing" in document.createElement("div").style ? oe("&::moz-focus-inner", {
  border: 0
}) : null, fe("border, state-border", `
 position: absolute;
 left: 0;
 top: 0;
 right: 0;
 bottom: 0;
 border-radius: inherit;
 transition: border-color .3s var(--n-bezier);
 pointer-events: none;
 `), fe("border", {
  border: "var(--n-border)"
}), fe("state-border", {
  border: "var(--n-border)",
  borderColor: "#0000",
  zIndex: 1
}), fe("icon", `
 margin: var(--n-icon-margin);
 margin-left: 0;
 height: var(--n-icon-size);
 width: var(--n-icon-size);
 max-width: var(--n-icon-size);
 font-size: var(--n-icon-size);
 position: relative;
 flex-shrink: 0;
 `, [Ye("icon-slot", `
 height: var(--n-icon-size);
 width: var(--n-icon-size);
 position: absolute;
 left: 0;
 top: 50%;
 transform: translateY(-50%);
 display: flex;
 align-items: center;
 justify-content: center;
 `, [kc({
  top: "50%",
  originalTransform: "translateY(-50%)"
})]), r_()]), fe("content", `
 display: flex;
 align-items: center;
 flex-wrap: nowrap;
 min-width: 0;
 `, [oe("~", [fe("icon", {
  margin: "var(--n-icon-margin)",
  marginRight: 0
})])]), Me("block", `
 display: flex;
 width: 100%;
 `), Me("dashed", [fe("border, state-border", {
  borderStyle: "dashed !important"
})]), Me("disabled", {
  cursor: "not-allowed",
  opacity: "var(--n-opacity-disabled)"
})]), oe("@keyframes button-wave-spread", {
  from: {
    boxShadow: "0 0 0.5px 0 var(--n-ripple-color)"
  },
  to: {
    // don't use exact 5px since chrome will display the animation with glitches
    boxShadow: "0 0 0.5px 4.5px var(--n-ripple-color)"
  }
}), oe("@keyframes button-wave-opacity", {
  from: {
    opacity: "var(--n-wave-opacity)"
  },
  to: {
    opacity: 0
  }
})]);
var d_ = {};
const f_ = Object.assign(Object.assign({}, tn.props), {
  color: String,
  textColor: String,
  text: Boolean,
  block: Boolean,
  loading: Boolean,
  disabled: Boolean,
  circle: Boolean,
  size: String,
  ghost: Boolean,
  round: Boolean,
  secondary: Boolean,
  tertiary: Boolean,
  quaternary: Boolean,
  strong: Boolean,
  focusable: {
    type: Boolean,
    default: !0
  },
  keyboard: {
    type: Boolean,
    default: !0
  },
  tag: {
    type: String,
    default: "button"
  },
  type: {
    type: String,
    default: "default"
  },
  dashed: Boolean,
  renderIcon: Function,
  iconPlacement: {
    type: String,
    default: "left"
  },
  attrType: {
    type: String,
    default: "button"
  },
  bordered: {
    type: Boolean,
    default: !0
  },
  onClick: [Function, Array],
  nativeFocusBehavior: {
    type: Boolean,
    default: !i_
  }
}), h_ = /* @__PURE__ */ bt({
  name: "Button",
  props: f_,
  setup(e) {
    d_.NODE_ENV !== "production" && il(() => {
      const {
        dashed: E,
        ghost: S,
        text: T,
        secondary: C,
        tertiary: _,
        quaternary: w
      } = e;
      (E || S || T) && (C || _ || w) && di("button", "`dashed`, `ghost` and `text` props can't be used along with `secondary`, `tertiary` and `quaternary` props.");
    });
    const t = Ee(null), n = Ee(null), r = Ee(!1), o = SC(() => !e.quaternary && !e.tertiary && !e.secondary && !e.text && (!e.color || e.ghost || e.dashed) && e.bordered), i = $t(s_, {}), {
      mergedSizeRef: s
    } = Cw({}, {
      defaultSize: "medium",
      mergedSize: (E) => {
        const {
          size: S
        } = e;
        if (S)
          return S;
        const {
          size: T
        } = i;
        if (T)
          return T;
        const {
          mergedSize: C
        } = E || {};
        return C ? C.value : "medium";
      }
    }), a = Te(() => e.focusable && !e.disabled), l = (E) => {
      var S;
      a.value || E.preventDefault(), !e.nativeFocusBehavior && (E.preventDefault(), !e.disabled && a.value && ((S = t.value) === null || S === void 0 || S.focus({
        preventScroll: !0
      })));
    }, c = (E) => {
      var S;
      if (!e.disabled && !e.loading) {
        const {
          onClick: T
        } = e;
        T && Sr(T, E), e.text || (S = n.value) === null || S === void 0 || S.play();
      }
    }, u = (E) => {
      switch (E.key) {
        case "Enter":
          if (!e.keyboard)
            return;
          r.value = !1;
      }
    }, d = (E) => {
      switch (E.key) {
        case "Enter":
          if (!e.keyboard || e.loading) {
            E.preventDefault();
            return;
          }
          r.value = !0;
      }
    }, f = () => {
      r.value = !1;
    }, {
      inlineThemeDisabled: m,
      mergedClsPrefixRef: h,
      mergedRtlRef: p
    } = hs(e), g = tn("Button", "-button", u_, Fg, e, h), v = yl("Button", p, h), y = Te(() => {
      const E = g.value, {
        common: {
          cubicBezierEaseInOut: S,
          cubicBezierEaseOut: T
        },
        self: C
      } = E, {
        rippleDuration: _,
        opacityDisabled: w,
        fontWeight: R,
        fontWeightStrong: O
      } = C, I = s.value, {
        dashed: L,
        type: D,
        ghost: P,
        text: k,
        color: N,
        round: $,
        circle: B,
        textColor: U,
        secondary: J,
        tertiary: te,
        quaternary: ie,
        strong: z
      } = e, le = {
        "font-weight": z ? O : R
      };
      let j = {
        "--n-color": "initial",
        "--n-color-hover": "initial",
        "--n-color-pressed": "initial",
        "--n-color-focus": "initial",
        "--n-color-disabled": "initial",
        "--n-ripple-color": "initial",
        "--n-text-color": "initial",
        "--n-text-color-hover": "initial",
        "--n-text-color-pressed": "initial",
        "--n-text-color-focus": "initial",
        "--n-text-color-disabled": "initial"
      };
      const pe = D === "tertiary", ne = D === "default", ee = pe ? "default" : D;
      if (k) {
        const V = U || N;
        j = {
          "--n-color": "#0000",
          "--n-color-hover": "#0000",
          "--n-color-pressed": "#0000",
          "--n-color-focus": "#0000",
          "--n-color-disabled": "#0000",
          "--n-ripple-color": "#0000",
          "--n-text-color": V || C[_e("textColorText", ee)],
          "--n-text-color-hover": V ? fr(V) : C[_e("textColorTextHover", ee)],
          "--n-text-color-pressed": V ? js(V) : C[_e("textColorTextPressed", ee)],
          "--n-text-color-focus": V ? fr(V) : C[_e("textColorTextHover", ee)],
          "--n-text-color-disabled": V || C[_e("textColorTextDisabled", ee)]
        };
      } else if (P || L) {
        const V = U || N;
        j = {
          "--n-color": "#0000",
          "--n-color-hover": "#0000",
          "--n-color-pressed": "#0000",
          "--n-color-focus": "#0000",
          "--n-color-disabled": "#0000",
          "--n-ripple-color": N || C[_e("rippleColor", ee)],
          "--n-text-color": V || C[_e("textColorGhost", ee)],
          "--n-text-color-hover": V ? fr(V) : C[_e("textColorGhostHover", ee)],
          "--n-text-color-pressed": V ? js(V) : C[_e("textColorGhostPressed", ee)],
          "--n-text-color-focus": V ? fr(V) : C[_e("textColorGhostHover", ee)],
          "--n-text-color-disabled": V || C[_e("textColorGhostDisabled", ee)]
        };
      } else if (J) {
        const V = ne ? C.textColor : pe ? C.textColorTertiary : C[_e("color", ee)], G = N || V, K = D !== "default" && D !== "tertiary";
        j = {
          "--n-color": K ? Ms(G, {
            alpha: Number(C.colorOpacitySecondary)
          }) : C.colorSecondary,
          "--n-color-hover": K ? Ms(G, {
            alpha: Number(C.colorOpacitySecondaryHover)
          }) : C.colorSecondaryHover,
          "--n-color-pressed": K ? Ms(G, {
            alpha: Number(C.colorOpacitySecondaryPressed)
          }) : C.colorSecondaryPressed,
          "--n-color-focus": K ? Ms(G, {
            alpha: Number(C.colorOpacitySecondaryHover)
          }) : C.colorSecondaryHover,
          "--n-color-disabled": C.colorSecondary,
          "--n-ripple-color": "#0000",
          "--n-text-color": G,
          "--n-text-color-hover": G,
          "--n-text-color-pressed": G,
          "--n-text-color-focus": G,
          "--n-text-color-disabled": G
        };
      } else if (te || ie) {
        const V = ne ? C.textColor : pe ? C.textColorTertiary : C[_e("color", ee)], G = N || V;
        te ? (j["--n-color"] = C.colorTertiary, j["--n-color-hover"] = C.colorTertiaryHover, j["--n-color-pressed"] = C.colorTertiaryPressed, j["--n-color-focus"] = C.colorSecondaryHover, j["--n-color-disabled"] = C.colorTertiary) : (j["--n-color"] = C.colorQuaternary, j["--n-color-hover"] = C.colorQuaternaryHover, j["--n-color-pressed"] = C.colorQuaternaryPressed, j["--n-color-focus"] = C.colorQuaternaryHover, j["--n-color-disabled"] = C.colorQuaternary), j["--n-ripple-color"] = "#0000", j["--n-text-color"] = G, j["--n-text-color-hover"] = G, j["--n-text-color-pressed"] = G, j["--n-text-color-focus"] = G, j["--n-text-color-disabled"] = G;
      } else
        j = {
          "--n-color": N || C[_e("color", ee)],
          "--n-color-hover": N ? fr(N) : C[_e("colorHover", ee)],
          "--n-color-pressed": N ? js(N) : C[_e("colorPressed", ee)],
          "--n-color-focus": N ? fr(N) : C[_e("colorFocus", ee)],
          "--n-color-disabled": N || C[_e("colorDisabled", ee)],
          "--n-ripple-color": N || C[_e("rippleColor", ee)],
          "--n-text-color": U || (N ? C.textColorPrimary : pe ? C.textColorTertiary : C[_e("textColor", ee)]),
          "--n-text-color-hover": U || (N ? C.textColorHoverPrimary : C[_e("textColorHover", ee)]),
          "--n-text-color-pressed": U || (N ? C.textColorPressedPrimary : C[_e("textColorPressed", ee)]),
          "--n-text-color-focus": U || (N ? C.textColorFocusPrimary : C[_e("textColorFocus", ee)]),
          "--n-text-color-disabled": U || (N ? C.textColorDisabledPrimary : C[_e("textColorDisabled", ee)])
        };
      let we = {
        "--n-border": "initial",
        "--n-border-hover": "initial",
        "--n-border-pressed": "initial",
        "--n-border-focus": "initial",
        "--n-border-disabled": "initial"
      };
      k ? we = {
        "--n-border": "none",
        "--n-border-hover": "none",
        "--n-border-pressed": "none",
        "--n-border-focus": "none",
        "--n-border-disabled": "none"
      } : we = {
        "--n-border": C[_e("border", ee)],
        "--n-border-hover": C[_e("borderHover", ee)],
        "--n-border-pressed": C[_e("borderPressed", ee)],
        "--n-border-focus": C[_e("borderFocus", ee)],
        "--n-border-disabled": C[_e("borderDisabled", ee)]
      };
      const {
        [_e("height", I)]: me,
        [_e("fontSize", I)]: De,
        [_e("padding", I)]: x,
        [_e("paddingRound", I)]: A,
        [_e("iconSize", I)]: F,
        [_e("borderRadius", I)]: H,
        [_e("iconMargin", I)]: W,
        waveOpacity: X
      } = C, Q = {
        "--n-width": B && !k ? me : "initial",
        "--n-height": k ? "initial" : me,
        "--n-font-size": De,
        "--n-padding": B || k ? "initial" : $ ? A : x,
        "--n-icon-size": F,
        "--n-icon-margin": W,
        "--n-border-radius": k ? "initial" : B || $ ? me : H
      };
      return Object.assign(Object.assign(Object.assign(Object.assign({
        "--n-bezier": S,
        "--n-bezier-ease-out": T,
        "--n-ripple-duration": _,
        "--n-opacity-disabled": w,
        "--n-wave-opacity": X
      }, le), j), we), Q);
    }), b = m ? ps("button", Te(() => {
      let E = "";
      const {
        dashed: S,
        type: T,
        ghost: C,
        text: _,
        color: w,
        round: R,
        circle: O,
        textColor: I,
        secondary: L,
        tertiary: D,
        quaternary: P,
        strong: k
      } = e;
      S && (E += "a"), C && (E += "b"), _ && (E += "c"), R && (E += "d"), O && (E += "e"), L && (E += "f"), D && (E += "g"), P && (E += "h"), k && (E += "i"), w && (E += "j" + ff(w)), I && (E += "k" + ff(I));
      const {
        value: N
      } = s;
      return E += "l" + N[0], E += "m" + T[0], E;
    }), y, e) : void 0;
    return {
      selfElRef: t,
      waveElRef: n,
      mergedClsPrefix: h,
      mergedFocusable: a,
      mergedSize: s,
      showBorder: o,
      enterPressed: r,
      rtlEnabled: v,
      handleMousedown: l,
      handleKeydown: d,
      handleBlur: f,
      handleKeyup: u,
      handleClick: c,
      customColorCssVars: Te(() => {
        const {
          color: E
        } = e;
        if (!E)
          return null;
        const S = fr(E);
        return {
          "--n-border-color": E,
          "--n-border-color-hover": S,
          "--n-border-color-pressed": js(E),
          "--n-border-color-focus": S,
          "--n-border-color-disabled": E
        };
      }),
      cssVars: m ? void 0 : y,
      themeClass: b == null ? void 0 : b.themeClass,
      onRender: b == null ? void 0 : b.onRender
    };
  },
  render() {
    const {
      mergedClsPrefix: e,
      tag: t,
      onRender: n
    } = this;
    n == null || n();
    const r = Xt(this.$slots.default, (o) => o && q("span", {
      class: `${e}-button__content`
    }, o));
    return q(t, {
      ref: "selfElRef",
      class: [
        this.themeClass,
        `${e}-button`,
        `${e}-button--${this.type}-type`,
        `${e}-button--${this.mergedSize}-type`,
        this.rtlEnabled && `${e}-button--rtl`,
        this.disabled && `${e}-button--disabled`,
        this.block && `${e}-button--block`,
        this.enterPressed && `${e}-button--pressed`,
        !this.text && this.dashed && `${e}-button--dashed`,
        this.color && `${e}-button--color`,
        this.secondary && `${e}-button--secondary`,
        this.loading && `${e}-button--loading`,
        this.ghost && `${e}-button--ghost`
        // required for button group border collapse
      ],
      tabindex: this.mergedFocusable ? 0 : -1,
      type: this.attrType,
      style: this.cssVars,
      disabled: this.disabled,
      onClick: this.handleClick,
      onBlur: this.handleBlur,
      onMousedown: this.handleMousedown,
      onKeyup: this.handleKeyup,
      onKeydown: this.handleKeydown
    }, this.iconPlacement === "right" && r, q(BE, {
      width: !0
    }, {
      default: () => Xt(this.$slots.icon, (o) => (this.loading || this.renderIcon || o) && q("span", {
        class: `${e}-button__icon`,
        style: {
          margin: X1(this.$slots.default) ? "0" : ""
        }
      }, q(Dg, null, {
        default: () => this.loading ? q(WE, {
          clsPrefix: e,
          key: "loading",
          class: `${e}-icon-slot`,
          strokeWidth: 20
        }) : q("div", {
          key: "icon",
          class: `${e}-icon-slot`,
          role: "none"
        }, this.renderIcon ? this.renderIcon() : o)
      })))
    }), this.iconPlacement === "left" && r, this.text ? null : q(n_, {
      ref: "waveElRef",
      clsPrefix: e
    }), this.showBorder ? q("div", {
      "aria-hidden": !0,
      class: `${e}-button__border`,
      style: this.customColorCssVars
    }) : null, this.showBorder ? q("div", {
      "aria-hidden": !0,
      class: `${e}-button__state-border`,
      style: this.customColorCssVars
    }) : null);
  }
}), ch = h_, p_ = {
  paddingSmall: "12px 16px 12px",
  paddingMedium: "19px 24px 20px",
  paddingLarge: "23px 32px 24px",
  paddingHuge: "27px 40px 28px",
  titleFontSizeSmall: "16px",
  titleFontSizeMedium: "18px",
  titleFontSizeLarge: "18px",
  titleFontSizeHuge: "18px",
  closeIconSize: "18px",
  closeSize: "22px"
}, m_ = (e) => {
  const {
    primaryColor: t,
    borderRadius: n,
    lineHeight: r,
    fontSize: o,
    cardColor: i,
    textColor2: s,
    textColor1: a,
    dividerColor: l,
    fontWeightStrong: c,
    closeIconColor: u,
    closeIconColorHover: d,
    closeIconColorPressed: f,
    closeColorHover: m,
    closeColorPressed: h,
    modalColor: p,
    boxShadow1: g,
    popoverColor: v,
    actionColor: y
  } = e;
  return Object.assign(Object.assign({}, p_), {
    lineHeight: r,
    color: i,
    colorModal: p,
    colorPopover: v,
    colorTarget: t,
    colorEmbedded: y,
    colorEmbeddedModal: y,
    colorEmbeddedPopover: y,
    textColor: s,
    titleTextColor: a,
    borderColor: l,
    actionColor: y,
    titleFontWeight: c,
    closeColorHover: m,
    closeColorPressed: h,
    closeBorderRadius: n,
    closeIconColor: u,
    closeIconColorHover: d,
    closeIconColorPressed: f,
    fontSizeSmall: o,
    fontSizeMedium: o,
    fontSizeLarge: o,
    fontSizeHuge: o,
    boxShadow: g,
    borderRadius: n
  });
}, g_ = {
  name: "Card",
  common: gs,
  self: m_
}, Bg = g_, v_ = oe([Ye("card", `
 font-size: var(--n-font-size);
 line-height: var(--n-line-height);
 display: flex;
 flex-direction: column;
 width: 100%;
 box-sizing: border-box;
 position: relative;
 border-radius: var(--n-border-radius);
 background-color: var(--n-color);
 color: var(--n-text-color);
 word-break: break-word;
 transition: 
 color .3s var(--n-bezier),
 background-color .3s var(--n-bezier),
 box-shadow .3s var(--n-bezier),
 border-color .3s var(--n-bezier);
 `, [jm({
  background: "var(--n-color-modal)"
}), Me("hoverable", [oe("&:hover", "box-shadow: var(--n-box-shadow);")]), Me("content-segmented", [oe(">", [fe("content", {
  paddingTop: "var(--n-padding-bottom)"
})])]), Me("content-soft-segmented", [oe(">", [fe("content", `
 margin: 0 var(--n-padding-left);
 padding: var(--n-padding-bottom) 0;
 `)])]), Me("footer-segmented", [oe(">", [fe("footer", {
  paddingTop: "var(--n-padding-bottom)"
})])]), Me("footer-soft-segmented", [oe(">", [fe("footer", `
 padding: var(--n-padding-bottom) 0;
 margin: 0 var(--n-padding-left);
 `)])]), oe(">", [Ye("card-header", `
 box-sizing: border-box;
 display: flex;
 align-items: center;
 font-size: var(--n-title-font-size);
 padding:
 var(--n-padding-top)
 var(--n-padding-left)
 var(--n-padding-bottom)
 var(--n-padding-left);
 `, [fe("main", `
 font-weight: var(--n-title-font-weight);
 transition: color .3s var(--n-bezier);
 flex: 1;
 min-width: 0;
 color: var(--n-title-text-color);
 `), fe("extra", `
 display: flex;
 align-items: center;
 font-size: var(--n-font-size);
 font-weight: 400;
 transition: color .3s var(--n-bezier);
 color: var(--n-text-color);
 `), fe("close", `
 margin: 0 0 0 8px;
 transition:
 background-color .3s var(--n-bezier),
 color .3s var(--n-bezier);
 `)]), fe("action", `
 box-sizing: border-box;
 transition:
 background-color .3s var(--n-bezier),
 border-color .3s var(--n-bezier);
 background-clip: padding-box;
 background-color: var(--n-action-color);
 `), fe("content", "flex: 1; min-width: 0;"), fe("content, footer", `
 box-sizing: border-box;
 padding: 0 var(--n-padding-left) var(--n-padding-bottom) var(--n-padding-left);
 font-size: var(--n-font-size);
 `, [oe("&:first-child", {
  paddingTop: "var(--n-padding-bottom)"
})]), fe("action", `
 background-color: var(--n-action-color);
 padding: var(--n-padding-bottom) var(--n-padding-left);
 border-bottom-left-radius: var(--n-border-radius);
 border-bottom-right-radius: var(--n-border-radius);
 `)]), Ye("card-cover", `
 overflow: hidden;
 width: 100%;
 border-radius: var(--n-border-radius) var(--n-border-radius) 0 0;
 `, [oe("img", `
 display: block;
 width: 100%;
 `)]), Me("bordered", `
 border: 1px solid var(--n-border-color);
 `, [oe("&:target", "border-color: var(--n-color-target);")]), Me("action-segmented", [oe(">", [fe("action", [oe("&:not(:first-child)", {
  borderTop: "1px solid var(--n-border-color)"
})])])]), Me("content-segmented, content-soft-segmented", [oe(">", [fe("content", {
  transition: "border-color 0.3s var(--n-bezier)"
}, [oe("&:not(:first-child)", {
  borderTop: "1px solid var(--n-border-color)"
})])])]), Me("footer-segmented, footer-soft-segmented", [oe(">", [fe("footer", {
  transition: "border-color 0.3s var(--n-bezier)"
}, [oe("&:not(:first-child)", {
  borderTop: "1px solid var(--n-border-color)"
})])])]), Me("embedded", `
 background-color: var(--n-color-embedded);
 `)]), zm(Ye("card", `
 background: var(--n-color-modal);
 `, [Me("embedded", `
 background-color: var(--n-color-embedded-modal);
 `)])), bC(Ye("card", `
 background: var(--n-color-popover);
 `, [Me("embedded", `
 background-color: var(--n-color-embedded-popover);
 `)]))]), Yu = {
  title: String,
  contentClass: String,
  contentStyle: [Object, String],
  headerClass: String,
  headerStyle: [Object, String],
  headerExtraClass: String,
  headerExtraStyle: [Object, String],
  footerClass: String,
  footerStyle: [Object, String],
  embedded: Boolean,
  segmented: {
    type: [Boolean, Object],
    default: !1
  },
  size: {
    type: String,
    default: "medium"
  },
  bordered: {
    type: Boolean,
    default: !0
  },
  closable: Boolean,
  hoverable: Boolean,
  role: String,
  onClose: [Function, Array],
  tag: {
    type: String,
    default: "div"
  }
}, y_ = zu(Yu), b_ = Object.assign(Object.assign({}, tn.props), Yu), Lg = /* @__PURE__ */ bt({
  name: "Card",
  props: b_,
  setup(e) {
    const t = () => {
      const {
        onClose: c
      } = e;
      c && Sr(c);
    }, {
      inlineThemeDisabled: n,
      mergedClsPrefixRef: r,
      mergedRtlRef: o
    } = hs(e), i = tn("Card", "-card", v_, Bg, e, r), s = yl("Card", o, r), a = Te(() => {
      const {
        size: c
      } = e, {
        self: {
          color: u,
          colorModal: d,
          colorTarget: f,
          textColor: m,
          titleTextColor: h,
          titleFontWeight: p,
          borderColor: g,
          actionColor: v,
          borderRadius: y,
          lineHeight: b,
          closeIconColor: E,
          closeIconColorHover: S,
          closeIconColorPressed: T,
          closeColorHover: C,
          closeColorPressed: _,
          closeBorderRadius: w,
          closeIconSize: R,
          closeSize: O,
          boxShadow: I,
          colorPopover: L,
          colorEmbedded: D,
          colorEmbeddedModal: P,
          colorEmbeddedPopover: k,
          [_e("padding", c)]: N,
          [_e("fontSize", c)]: $,
          [_e("titleFontSize", c)]: B
        },
        common: {
          cubicBezierEaseInOut: U
        }
      } = i.value, {
        top: J,
        left: te,
        bottom: ie
      } = $m(N);
      return {
        "--n-bezier": U,
        "--n-border-radius": y,
        "--n-color": u,
        "--n-color-modal": d,
        "--n-color-popover": L,
        "--n-color-embedded": D,
        "--n-color-embedded-modal": P,
        "--n-color-embedded-popover": k,
        "--n-color-target": f,
        "--n-text-color": m,
        "--n-line-height": b,
        "--n-action-color": v,
        "--n-title-text-color": h,
        "--n-title-font-weight": p,
        "--n-close-icon-color": E,
        "--n-close-icon-color-hover": S,
        "--n-close-icon-color-pressed": T,
        "--n-close-color-hover": C,
        "--n-close-color-pressed": _,
        "--n-border-color": g,
        "--n-box-shadow": I,
        // size
        "--n-padding-top": J,
        "--n-padding-bottom": ie,
        "--n-padding-left": te,
        "--n-font-size": $,
        "--n-title-font-size": B,
        "--n-close-size": O,
        "--n-close-icon-size": R,
        "--n-close-border-radius": w
      };
    }), l = n ? ps("card", Te(() => e.size[0]), a, e) : void 0;
    return {
      rtlEnabled: s,
      mergedClsPrefix: r,
      mergedTheme: i,
      handleCloseClick: t,
      cssVars: n ? void 0 : a,
      themeClass: l == null ? void 0 : l.themeClass,
      onRender: l == null ? void 0 : l.onRender
    };
  },
  render() {
    const {
      segmented: e,
      bordered: t,
      hoverable: n,
      mergedClsPrefix: r,
      rtlEnabled: o,
      onRender: i,
      embedded: s,
      tag: a,
      $slots: l
    } = this;
    return i == null || i(), q(a, {
      class: [`${r}-card`, this.themeClass, s && `${r}-card--embedded`, {
        [`${r}-card--rtl`]: o,
        [`${r}-card--content${typeof e != "boolean" && e.content === "soft" ? "-soft" : ""}-segmented`]: e === !0 || e !== !1 && e.content,
        [`${r}-card--footer${typeof e != "boolean" && e.footer === "soft" ? "-soft" : ""}-segmented`]: e === !0 || e !== !1 && e.footer,
        [`${r}-card--action-segmented`]: e === !0 || e !== !1 && e.action,
        [`${r}-card--bordered`]: t,
        [`${r}-card--hoverable`]: n
      }],
      style: this.cssVars,
      role: this.role
    }, Xt(l.cover, (c) => c && q("div", {
      class: `${r}-card-cover`,
      role: "none"
    }, c)), Xt(l.header, (c) => c || this.title || this.closable ? q("div", {
      class: [`${r}-card-header`, this.headerClass],
      style: this.headerStyle
    }, q("div", {
      class: `${r}-card-header__main`,
      role: "heading"
    }, c || this.title), Xt(l["header-extra"], (u) => u && q("div", {
      class: [`${r}-card-header__extra`, this.headerExtraClass],
      style: this.headerExtraStyle
    }, u)), this.closable ? q($g, {
      clsPrefix: r,
      class: `${r}-card-header__close`,
      onClick: this.handleCloseClick,
      absolute: !0
    }) : null) : null), Xt(l.default, (c) => c && q("div", {
      class: [`${r}-card__content`, this.contentClass],
      style: this.contentStyle,
      role: "none"
    }, c)), Xt(l.footer, (c) => c && [q("div", {
      class: [`${r}-card__footer`, this.footerClass],
      style: this.footerStyle,
      role: "none"
    }, c)]), Xt(l.action, (c) => c && q("div", {
      class: `${r}-card__action`,
      role: "none"
    }, c)));
  }
});
var C_ = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : {};
function w_(e) {
  return e && e.__esModule && Object.prototype.hasOwnProperty.call(e, "default") ? e.default : e;
}
const x_ = {
  titleFontSize: "18px",
  padding: "16px 28px 20px 28px",
  iconSize: "28px",
  actionSpace: "12px",
  contentMargin: "8px 0 16px 0",
  iconMargin: "0 4px 0 0",
  iconMarginIconTop: "4px 0 8px 0",
  closeSize: "22px",
  closeIconSize: "18px",
  closeMargin: "20px 26px 0 0",
  closeMarginIconTop: "10px 16px 0 0"
}, S_ = (e) => {
  const {
    textColor1: t,
    textColor2: n,
    modalColor: r,
    closeIconColor: o,
    closeIconColorHover: i,
    closeIconColorPressed: s,
    closeColorHover: a,
    closeColorPressed: l,
    infoColor: c,
    successColor: u,
    warningColor: d,
    errorColor: f,
    primaryColor: m,
    dividerColor: h,
    borderRadius: p,
    fontWeightStrong: g,
    lineHeight: v,
    fontSize: y
  } = e;
  return Object.assign(Object.assign({}, x_), {
    fontSize: y,
    lineHeight: v,
    border: `1px solid ${h}`,
    titleTextColor: t,
    textColor: n,
    color: r,
    closeColorHover: a,
    closeColorPressed: l,
    closeIconColor: o,
    closeIconColorHover: i,
    closeIconColorPressed: s,
    closeBorderRadius: p,
    iconColor: m,
    iconColorInfo: c,
    iconColorSuccess: u,
    iconColorWarning: d,
    iconColorError: f,
    borderRadius: p,
    titleFontWeight: g
  });
}, E_ = {
  name: "Dialog",
  common: gs,
  peers: {
    Button: Fg
  },
  self: S_
}, Vg = E_, qu = {
  icon: Function,
  type: {
    type: String,
    default: "default"
  },
  title: [String, Function],
  closable: {
    type: Boolean,
    default: !0
  },
  negativeText: String,
  positiveText: String,
  positiveButtonProps: Object,
  negativeButtonProps: Object,
  content: [String, Function],
  action: Function,
  showIcon: {
    type: Boolean,
    default: !0
  },
  loading: Boolean,
  bordered: Boolean,
  iconPlacement: String,
  onPositiveClick: Function,
  onNegativeClick: Function,
  onClose: Function
}, __ = zu(qu), I_ = oe([Ye("dialog", `
 --n-icon-margin: var(--n-icon-margin-top) var(--n-icon-margin-right) var(--n-icon-margin-bottom) var(--n-icon-margin-left);
 word-break: break-word;
 line-height: var(--n-line-height);
 position: relative;
 background: var(--n-color);
 color: var(--n-text-color);
 box-sizing: border-box;
 margin: auto;
 border-radius: var(--n-border-radius);
 padding: var(--n-padding);
 transition: 
 border-color .3s var(--n-bezier),
 background-color .3s var(--n-bezier),
 color .3s var(--n-bezier);
 `, [fe("icon", {
  color: "var(--n-icon-color)"
}), Me("bordered", {
  border: "var(--n-border)"
}), Me("icon-top", [fe("close", {
  margin: "var(--n-close-margin)"
}), fe("icon", {
  margin: "var(--n-icon-margin)"
}), fe("content", {
  textAlign: "center"
}), fe("title", {
  justifyContent: "center"
}), fe("action", {
  justifyContent: "center"
})]), Me("icon-left", [fe("icon", {
  margin: "var(--n-icon-margin)"
}), Me("closable", [fe("title", `
 padding-right: calc(var(--n-close-size) + 6px);
 `)])]), fe("close", `
 position: absolute;
 right: 0;
 top: 0;
 margin: var(--n-close-margin);
 transition:
 background-color .3s var(--n-bezier),
 color .3s var(--n-bezier);
 z-index: 1;
 `), fe("content", `
 font-size: var(--n-font-size);
 margin: var(--n-content-margin);
 position: relative;
 word-break: break-word;
 `, [Me("last", "margin-bottom: 0;")]), fe("action", `
 display: flex;
 justify-content: flex-end;
 `, [oe("> *:not(:last-child)", `
 margin-right: var(--n-action-space);
 `)]), fe("icon", `
 font-size: var(--n-icon-size);
 transition: color .3s var(--n-bezier);
 `), fe("title", `
 transition: color .3s var(--n-bezier);
 display: flex;
 align-items: center;
 font-size: var(--n-title-font-size);
 font-weight: var(--n-title-font-weight);
 color: var(--n-title-text-color);
 `), Ye("dialog-icon-container", `
 display: flex;
 justify-content: center;
 `)]), zm(Ye("dialog", `
 width: 446px;
 max-width: calc(100vw - 32px);
 `)), Ye("dialog", [jm(`
 width: 446px;
 max-width: calc(100vw - 32px);
 `)])]), N_ = {
  default: () => q(oh, null),
  info: () => q(oh, null),
  success: () => q(PE, null),
  warning: () => q(FE, null),
  error: () => q(RE, null)
}, T_ = /* @__PURE__ */ bt({
  name: "Dialog",
  alias: [
    "NimbusConfirmCard",
    // deprecated
    "Confirm"
    // deprecated
  ],
  props: Object.assign(Object.assign({}, tn.props), qu),
  setup(e) {
    const {
      mergedComponentPropsRef: t,
      mergedClsPrefixRef: n,
      inlineThemeDisabled: r,
      mergedRtlRef: o
    } = hs(e), i = yl("Dialog", o, n), s = Te(() => {
      var m, h;
      const {
        iconPlacement: p
      } = e;
      return p || ((h = (m = t == null ? void 0 : t.value) === null || m === void 0 ? void 0 : m.Dialog) === null || h === void 0 ? void 0 : h.iconPlacement) || "left";
    });
    function a(m) {
      const {
        onPositiveClick: h
      } = e;
      h && h(m);
    }
    function l(m) {
      const {
        onNegativeClick: h
      } = e;
      h && h(m);
    }
    function c() {
      const {
        onClose: m
      } = e;
      m && m();
    }
    const u = tn("Dialog", "-dialog", I_, Vg, e, n), d = Te(() => {
      const {
        type: m
      } = e, h = s.value, {
        common: {
          cubicBezierEaseInOut: p
        },
        self: {
          fontSize: g,
          lineHeight: v,
          border: y,
          titleTextColor: b,
          textColor: E,
          color: S,
          closeBorderRadius: T,
          closeColorHover: C,
          closeColorPressed: _,
          closeIconColor: w,
          closeIconColorHover: R,
          closeIconColorPressed: O,
          closeIconSize: I,
          borderRadius: L,
          titleFontWeight: D,
          titleFontSize: P,
          padding: k,
          iconSize: N,
          actionSpace: $,
          contentMargin: B,
          closeSize: U,
          [h === "top" ? "iconMarginIconTop" : "iconMargin"]: J,
          [h === "top" ? "closeMarginIconTop" : "closeMargin"]: te,
          [_e("iconColor", m)]: ie
        }
      } = u.value, z = $m(J);
      return {
        "--n-font-size": g,
        "--n-icon-color": ie,
        "--n-bezier": p,
        "--n-close-margin": te,
        "--n-icon-margin-top": z.top,
        "--n-icon-margin-right": z.right,
        "--n-icon-margin-bottom": z.bottom,
        "--n-icon-margin-left": z.left,
        "--n-icon-size": N,
        "--n-close-size": U,
        "--n-close-icon-size": I,
        "--n-close-border-radius": T,
        "--n-close-color-hover": C,
        "--n-close-color-pressed": _,
        "--n-close-icon-color": w,
        "--n-close-icon-color-hover": R,
        "--n-close-icon-color-pressed": O,
        "--n-color": S,
        "--n-text-color": E,
        "--n-border-radius": L,
        "--n-padding": k,
        "--n-line-height": v,
        "--n-border": y,
        "--n-content-margin": B,
        "--n-title-font-size": P,
        "--n-title-font-weight": D,
        "--n-title-text-color": b,
        "--n-action-space": $
      };
    }), f = r ? ps("dialog", Te(() => `${e.type[0]}${s.value[0]}`), d, e) : void 0;
    return {
      mergedClsPrefix: n,
      rtlEnabled: i,
      mergedIconPlacement: s,
      mergedTheme: u,
      handlePositiveClick: a,
      handleNegativeClick: l,
      handleCloseClick: c,
      cssVars: r ? void 0 : d,
      themeClass: f == null ? void 0 : f.themeClass,
      onRender: f == null ? void 0 : f.onRender
    };
  },
  render() {
    var e;
    const {
      bordered: t,
      mergedIconPlacement: n,
      cssVars: r,
      closable: o,
      showIcon: i,
      title: s,
      content: a,
      action: l,
      negativeText: c,
      positiveText: u,
      positiveButtonProps: d,
      negativeButtonProps: f,
      handlePositiveClick: m,
      handleNegativeClick: h,
      mergedTheme: p,
      loading: g,
      type: v,
      mergedClsPrefix: y
    } = this;
    (e = this.onRender) === null || e === void 0 || e.call(this);
    const b = i ? q(Mg, {
      clsPrefix: y,
      class: `${y}-dialog__icon`
    }, {
      default: () => Xt(this.$slots.icon, (S) => S || (this.icon ? Jr(this.icon) : N_[this.type]()))
    }) : null, E = Xt(this.$slots.action, (S) => S || u || c || l ? q("div", {
      class: `${y}-dialog__action`
    }, S || (l ? [Jr(l)] : [this.negativeText && q(ch, Object.assign({
      theme: p.peers.Button,
      themeOverrides: p.peerOverrides.Button,
      ghost: !0,
      size: "small",
      onClick: h
    }, f), {
      default: () => Jr(this.negativeText)
    }), this.positiveText && q(ch, Object.assign({
      theme: p.peers.Button,
      themeOverrides: p.peerOverrides.Button,
      size: "small",
      type: v === "default" ? "primary" : v,
      disabled: g,
      loading: g,
      onClick: m
    }, d), {
      default: () => Jr(this.positiveText)
    })])) : null);
    return q("div", {
      class: [`${y}-dialog`, this.themeClass, this.closable && `${y}-dialog--closable`, `${y}-dialog--icon-${n}`, t && `${y}-dialog--bordered`, this.rtlEnabled && `${y}-dialog--rtl`],
      style: r,
      role: "dialog"
    }, o ? Xt(this.$slots.close, (S) => {
      const T = [`${y}-dialog__close`, this.rtlEnabled && `${y}-dialog--rtl`];
      return S ? q("div", {
        class: T
      }, S) : q($g, {
        clsPrefix: y,
        class: T,
        onClick: this.handleCloseClick
      });
    }) : null, i && n === "top" ? q("div", {
      class: `${y}-dialog-icon-container`
    }, b) : null, q("div", {
      class: `${y}-dialog__title`
    }, i && n === "left" ? b : null, uf(this.$slots.header, () => [Jr(s)])), q("div", {
      class: [`${y}-dialog__content`, E ? "" : `${y}-dialog__content--last`]
    }, uf(this.$slots.default, () => [Jr(a)])), E);
  }
}), O_ = "n-dialog-provider", A_ = (e) => {
  const {
    modalColor: t,
    textColor2: n,
    boxShadow3: r
  } = e;
  return {
    color: t,
    textColor: n,
    boxShadow: r
  };
}, D_ = {
  name: "Modal",
  common: gs,
  peers: {
    Scrollbar: Rg,
    Dialog: Vg,
    Card: Bg
  },
  self: A_
}, M_ = D_, Zu = Object.assign(Object.assign({}, Yu), qu), $_ = zu(Zu), k_ = /* @__PURE__ */ bt({
  name: "ModalBody",
  inheritAttrs: !1,
  props: Object.assign(Object.assign({
    show: {
      type: Boolean,
      required: !0
    },
    preset: String,
    displayDirective: {
      type: String,
      required: !0
    },
    trapFocus: {
      type: Boolean,
      default: !0
    },
    autoFocus: {
      type: Boolean,
      default: !0
    },
    blockScroll: Boolean
  }, Zu), {
    renderMask: Function,
    // events
    onClickoutside: Function,
    onBeforeLeave: {
      type: Function,
      required: !0
    },
    onAfterLeave: {
      type: Function,
      required: !0
    },
    onPositiveClick: {
      type: Function,
      required: !0
    },
    onNegativeClick: {
      type: Function,
      required: !0
    },
    onClose: {
      type: Function,
      required: !0
    },
    onAfterEnter: Function,
    onEsc: Function
  }),
  setup(e) {
    const t = Ee(null), n = Ee(null), r = Ee(e.show), o = Ee(null), i = Ee(null);
    _n(nr(e, "show"), (g) => {
      g && (r.value = !0);
    }), vw(Te(() => e.blockScroll && r.value));
    const s = $t(Gm);
    function a() {
      if (s.transformOriginRef.value === "center")
        return "";
      const {
        value: g
      } = o, {
        value: v
      } = i;
      if (g === null || v === null)
        return "";
      if (n.value) {
        const y = n.value.containerScrollTop;
        return `${g}px ${v + y}px`;
      }
      return "";
    }
    function l(g) {
      if (s.transformOriginRef.value === "center")
        return;
      const v = s.getMousePosition();
      if (!v || !n.value)
        return;
      const y = n.value.containerScrollTop, {
        offsetLeft: b,
        offsetTop: E
      } = g;
      if (v) {
        const S = v.y, T = v.x;
        o.value = -(b - T), i.value = -(E - S - y);
      }
      g.style.transformOrigin = a();
    }
    function c(g) {
      Li(() => {
        l(g);
      });
    }
    function u(g) {
      g.style.transformOrigin = a(), e.onBeforeLeave();
    }
    function d() {
      r.value = !1, o.value = null, i.value = null, e.onAfterLeave();
    }
    function f() {
      const {
        onClose: g
      } = e;
      g && g();
    }
    function m() {
      e.onNegativeClick();
    }
    function h() {
      e.onPositiveClick();
    }
    const p = Ee(null);
    return _n(p, (g) => {
      g && Li(() => {
        const v = g.el;
        v && t.value !== v && (t.value = v);
      });
    }), xo(kC, t), xo(RC, null), xo(PC, null), {
      mergedTheme: s.mergedThemeRef,
      appear: s.appearRef,
      isMounted: s.isMountedRef,
      mergedClsPrefix: s.mergedClsPrefixRef,
      bodyRef: t,
      scrollbarRef: n,
      displayed: r,
      childNodeRef: p,
      handlePositiveClick: h,
      handleNegativeClick: m,
      handleCloseClick: f,
      handleAfterLeave: d,
      handleBeforeLeave: u,
      handleEnter: c
    };
  },
  render() {
    const {
      $slots: e,
      $attrs: t,
      handleEnter: n,
      handleAfterLeave: r,
      handleBeforeLeave: o,
      preset: i,
      mergedClsPrefix: s
    } = this;
    let a = null;
    if (!i) {
      if (a = Z1(e), !a) {
        Ec("modal", "default slot is empty");
        return;
      }
      a = en(a), a.props = Pu({
        class: `${s}-modal`
      }, t, a.props || {});
    }
    return this.displayDirective === "show" || this.displayed || this.show ? uc(q("div", {
      role: "none",
      class: `${s}-modal-body-wrapper`
    }, q(QE, {
      ref: "scrollbarRef",
      theme: this.mergedTheme.peers.Scrollbar,
      themeOverrides: this.mergedTheme.peerOverrides.Scrollbar,
      contentClass: `${s}-modal-scroll-content`
    }, {
      default: () => {
        var l;
        return [(l = this.renderMask) === null || l === void 0 ? void 0 : l.call(this), q(gw, {
          disabled: !this.trapFocus,
          active: this.show,
          onEsc: this.onEsc,
          autoFocus: this.autoFocus
        }, {
          default: () => {
            var c;
            return q(rr, {
              name: "fade-in-scale-up-transition",
              appear: (c = this.appear) !== null && c !== void 0 ? c : this.isMounted,
              onEnter: n,
              onAfterEnter: this.onAfterEnter,
              onAfterLeave: r,
              onBeforeLeave: o
            }, {
              default: () => {
                const u = [[Jd, this.show]], {
                  onClickoutside: d
                } = this;
                return d && u.push([BC, this.onClickoutside, void 0, {
                  capture: !0
                }]), uc(this.preset === "confirm" || this.preset === "dialog" ? q(T_, Object.assign({}, this.$attrs, {
                  class: [`${s}-modal`, this.$attrs.class],
                  ref: "bodyRef",
                  theme: this.mergedTheme.peers.Dialog,
                  themeOverrides: this.mergedTheme.peerOverrides.Dialog
                }, xc(this.$props, __), {
                  "aria-modal": "true"
                }), e) : this.preset === "card" ? q(Lg, Object.assign({}, this.$attrs, {
                  ref: "bodyRef",
                  class: [`${s}-modal`, this.$attrs.class],
                  theme: this.mergedTheme.peers.Card,
                  themeOverrides: this.mergedTheme.peerOverrides.Card
                }, xc(this.$props, y_), {
                  "aria-modal": "true",
                  role: "dialog"
                }), e) : this.childNodeRef = a, u);
              }
            });
          }
        })];
      }
    })), [[Jd, this.displayDirective === "if" || this.displayed || this.show]]) : null;
  }
}), R_ = oe([Ye("modal-container", `
 position: fixed;
 left: 0;
 top: 0;
 height: 0;
 width: 0;
 display: flex;
 `), Ye("modal-mask", `
 position: fixed;
 left: 0;
 right: 0;
 top: 0;
 bottom: 0;
 background-color: rgba(0, 0, 0, .4);
 `, [Pg({
  enterDuration: ".25s",
  leaveDuration: ".25s",
  enterCubicBezier: "var(--n-bezier-ease-out)",
  leaveCubicBezier: "var(--n-bezier-ease-out)"
})]), Ye("modal-body-wrapper", `
 position: fixed;
 left: 0;
 right: 0;
 top: 0;
 bottom: 0;
 overflow: visible;
 `, [Ye("modal-scroll-content", `
 min-height: 100%;
 display: flex;
 position: relative;
 `)]), Ye("modal", `
 position: relative;
 align-self: center;
 color: var(--n-text-color);
 margin: auto;
 box-shadow: var(--n-box-shadow);
 `, [e_({
  duration: ".25s",
  enterScale: ".5"
})])]);
var P_ = {};
const F_ = Object.assign(Object.assign(Object.assign(Object.assign({}, tn.props), {
  show: Boolean,
  unstableShowMask: {
    type: Boolean,
    default: !0
  },
  maskClosable: {
    type: Boolean,
    default: !0
  },
  preset: String,
  to: [String, Object],
  displayDirective: {
    type: String,
    default: "if"
  },
  transformOrigin: {
    type: String,
    default: "mouse"
  },
  zIndex: Number,
  autoFocus: {
    type: Boolean,
    default: !0
  },
  trapFocus: {
    type: Boolean,
    default: !0
  },
  closeOnEsc: {
    type: Boolean,
    default: !0
  },
  blockScroll: {
    type: Boolean,
    default: !0
  }
}), Zu), {
  // events
  onEsc: Function,
  "onUpdate:show": [Function, Array],
  onUpdateShow: [Function, Array],
  onAfterEnter: Function,
  onBeforeLeave: Function,
  onAfterLeave: Function,
  onClose: Function,
  onPositiveClick: Function,
  onNegativeClick: Function,
  onMaskClick: Function,
  // private
  internalDialog: Boolean,
  internalAppear: {
    type: Boolean,
    default: void 0
  },
  // deprecated
  overlayStyle: [String, Object],
  onBeforeHide: Function,
  onAfterHide: Function,
  onHide: Function
}), B_ = /* @__PURE__ */ bt({
  name: "Modal",
  inheritAttrs: !1,
  props: F_,
  setup(e) {
    P_.NODE_ENV !== "production" && (e.onHide && di("modal", "`on-hide` is deprecated."), e.onAfterHide && di("modal", "`on-after-hide` is deprecated, please use `on-after-leave` instead."), e.onBeforeHide && di("modal", "`on-before-hide` is deprecated, please use `on-before-leave` instead."), e.overlayStyle && di("modal", "`overlay-style` is deprecated, please use `style` instead."));
    const t = Ee(null), {
      mergedClsPrefixRef: n,
      namespaceRef: r,
      inlineThemeDisabled: o
    } = hs(e), i = tn("Modal", "-modal", R_, M_, e, n), s = DC(64), a = OC(), l = Km(), c = e.internalDialog ? $t(O_, null) : null, u = yw();
    function d(S) {
      const {
        onUpdateShow: T,
        "onUpdate:show": C,
        onHide: _
      } = e;
      T && Sr(T, S), C && Sr(C, S), _ && !S && _(S);
    }
    function f() {
      const {
        onClose: S
      } = e;
      S ? Promise.resolve(S()).then((T) => {
        T !== !1 && d(!1);
      }) : d(!1);
    }
    function m() {
      const {
        onPositiveClick: S
      } = e;
      S ? Promise.resolve(S()).then((T) => {
        T !== !1 && d(!1);
      }) : d(!1);
    }
    function h() {
      const {
        onNegativeClick: S
      } = e;
      S ? Promise.resolve(S()).then((T) => {
        T !== !1 && d(!1);
      }) : d(!1);
    }
    function p() {
      const {
        onBeforeLeave: S,
        onBeforeHide: T
      } = e;
      S && Sr(S), T && T();
    }
    function g() {
      const {
        onAfterLeave: S,
        onAfterHide: T
      } = e;
      S && Sr(S), T && T();
    }
    function v(S) {
      var T;
      const {
        onMaskClick: C
      } = e;
      C && C(S), e.maskClosable && !((T = t.value) === null || T === void 0) && T.contains(Lu(S)) && d(!1);
    }
    function y(S) {
      var T;
      (T = e.onEsc) === null || T === void 0 || T.call(e), e.show && e.closeOnEsc && wC(S) && !u.value && d(!1);
    }
    xo(Gm, {
      getMousePosition: () => {
        if (c) {
          const {
            clickedRef: S,
            clickPositionRef: T
          } = c;
          if (S.value && T.value)
            return T.value;
        }
        return s.value ? a.value : null;
      },
      mergedClsPrefixRef: n,
      mergedThemeRef: i,
      isMountedRef: l,
      appearRef: nr(e, "internalAppear"),
      transformOriginRef: nr(e, "transformOrigin")
    });
    const b = Te(() => {
      const {
        common: {
          cubicBezierEaseOut: S
        },
        self: {
          boxShadow: T,
          color: C,
          textColor: _
        }
      } = i.value;
      return {
        "--n-bezier-ease-out": S,
        "--n-box-shadow": T,
        "--n-color": C,
        "--n-text-color": _
      };
    }), E = o ? ps("theme-class", void 0, b, e) : void 0;
    return {
      mergedClsPrefix: n,
      namespace: r,
      isMounted: l,
      containerRef: t,
      presetProps: Te(() => xc(e, $_)),
      handleEsc: y,
      handleAfterLeave: g,
      handleClickoutside: v,
      handleBeforeLeave: p,
      doUpdateShow: d,
      handleNegativeClick: h,
      handlePositiveClick: m,
      handleCloseClick: f,
      cssVars: o ? void 0 : b,
      themeClass: E == null ? void 0 : E.themeClass,
      onRender: E == null ? void 0 : E.onRender
    };
  },
  render() {
    const {
      mergedClsPrefix: e
    } = this;
    return q(KC, {
      to: this.to,
      show: this.show
    }, {
      default: () => {
        var t;
        (t = this.onRender) === null || t === void 0 || t.call(this);
        const {
          unstableShowMask: n
        } = this;
        return uc(q("div", {
          role: "none",
          ref: "containerRef",
          class: [`${e}-modal-container`, this.themeClass, this.namespace],
          style: this.cssVars
        }, q(k_, Object.assign({
          style: this.overlayStyle
        }, this.$attrs, {
          ref: "bodyWrapper",
          displayDirective: this.displayDirective,
          show: this.show,
          preset: this.preset,
          autoFocus: this.autoFocus,
          trapFocus: this.trapFocus,
          blockScroll: this.blockScroll
        }, this.presetProps, {
          onEsc: this.handleEsc,
          onClose: this.handleCloseClick,
          onNegativeClick: this.handleNegativeClick,
          onPositiveClick: this.handlePositiveClick,
          onBeforeLeave: this.handleBeforeLeave,
          onAfterEnter: this.onAfterEnter,
          onAfterLeave: this.handleAfterLeave,
          onClickoutside: n ? void 0 : this.handleClickoutside,
          renderMask: n ? () => {
            var r;
            return q(rr, {
              name: "fade-in-transition",
              key: "mask",
              appear: (r = this.internalAppear) !== null && r !== void 0 ? r : this.isMounted
            }, {
              default: () => this.show ? q("div", {
                "aria-hidden": !0,
                ref: "containerRef",
                class: `${e}-modal-mask`,
                onClick: this.handleClickoutside
              }) : null
            });
          } : void 0
        }), this.$slots)), [[jC, {
          zIndex: this.zIndex,
          enabled: this.show
        }]]);
      }
    });
  }
}), Ge = typeof globalThis < "u" ? globalThis : typeof self < "u" ? self : typeof window < "u" ? window : global, st = Object.keys, _t = Array.isArray;
function kt(e, t) {
  return typeof t != "object" || st(t).forEach(function(n) {
    e[n] = t[n];
  }), e;
}
typeof Promise > "u" || Ge.Promise || (Ge.Promise = Promise);
const qi = Object.getPrototypeOf, L_ = {}.hasOwnProperty;
function Vt(e, t) {
  return L_.call(e, t);
}
function $o(e, t) {
  typeof t == "function" && (t = t(qi(e))), (typeof Reflect > "u" ? st : Reflect.ownKeys)(t).forEach((n) => {
    In(e, n, t[n]);
  });
}
const zg = Object.defineProperty;
function In(e, t, n, r) {
  zg(e, t, kt(n && Vt(n, "get") && typeof n.get == "function" ? { get: n.get, set: n.set, configurable: !0 } : { value: n, configurable: !0, writable: !0 }, r));
}
function _o(e) {
  return { from: function(t) {
    return e.prototype = Object.create(t.prototype), In(e.prototype, "constructor", e), { extend: $o.bind(null, e.prototype) };
  } };
}
const V_ = Object.getOwnPropertyDescriptor;
function Xu(e, t) {
  let n;
  return V_(e, t) || (n = qi(e)) && Xu(n, t);
}
const z_ = [].slice;
function Da(e, t, n) {
  return z_.call(e, t, n);
}
function jg(e, t) {
  return t(e);
}
function hi(e) {
  if (!e)
    throw new Error("Assertion Failed");
}
function Hg(e) {
  Ge.setImmediate ? setImmediate(e) : setTimeout(e, 0);
}
function Wg(e, t) {
  return e.reduce((n, r, o) => {
    var i = t(r, o);
    return i && (n[i[0]] = i[1]), n;
  }, {});
}
function Nn(e, t) {
  if (Vt(e, t))
    return e[t];
  if (!t)
    return e;
  if (typeof t != "string") {
    for (var n = [], r = 0, o = t.length; r < o; ++r) {
      var i = Nn(e, t[r]);
      n.push(i);
    }
    return n;
  }
  var s = t.indexOf(".");
  if (s !== -1) {
    var a = e[t.substr(0, s)];
    return a === void 0 ? void 0 : Nn(a, t.substr(s + 1));
  }
}
function Qt(e, t, n) {
  if (e && t !== void 0 && (!("isFrozen" in Object) || !Object.isFrozen(e)))
    if (typeof t != "string" && "length" in t) {
      hi(typeof n != "string" && "length" in n);
      for (var r = 0, o = t.length; r < o; ++r)
        Qt(e, t[r], n[r]);
    } else {
      var i = t.indexOf(".");
      if (i !== -1) {
        var s = t.substr(0, i), a = t.substr(i + 1);
        if (a === "")
          n === void 0 ? _t(e) && !isNaN(parseInt(s)) ? e.splice(s, 1) : delete e[s] : e[s] = n;
        else {
          var l = e[s];
          l && Vt(e, s) || (l = e[s] = {}), Qt(l, a, n);
        }
      } else
        n === void 0 ? _t(e) && !isNaN(parseInt(t)) ? e.splice(t, 1) : delete e[t] : e[t] = n;
    }
}
function Ug(e) {
  var t = {};
  for (var n in e)
    Vt(e, n) && (t[n] = e[n]);
  return t;
}
const j_ = [].concat;
function Kg(e) {
  return j_.apply([], e);
}
const Gg = "Boolean,String,Date,RegExp,Blob,File,FileList,FileSystemFileHandle,ArrayBuffer,DataView,Uint8ClampedArray,ImageBitmap,ImageData,Map,Set,CryptoKey".split(",").concat(Kg([8, 16, 32, 64].map((e) => ["Int", "Uint", "Float"].map((t) => t + e + "Array")))).filter((e) => Ge[e]), H_ = Gg.map((e) => Ge[e]);
Wg(Gg, (e) => [e, !0]);
let Hn = null;
function vs(e) {
  Hn = typeof WeakMap < "u" && /* @__PURE__ */ new WeakMap();
  const t = Rc(e);
  return Hn = null, t;
}
function Rc(e) {
  if (!e || typeof e != "object")
    return e;
  let t = Hn && Hn.get(e);
  if (t)
    return t;
  if (_t(e)) {
    t = [], Hn && Hn.set(e, t);
    for (var n = 0, r = e.length; n < r; ++n)
      t.push(Rc(e[n]));
  } else if (H_.indexOf(e.constructor) >= 0)
    t = e;
  else {
    const i = qi(e);
    for (var o in t = i === Object.prototype ? {} : Object.create(i), Hn && Hn.set(e, t), e)
      Vt(e, o) && (t[o] = Rc(e[o]));
  }
  return t;
}
const { toString: W_ } = {};
function Pc(e) {
  return W_.call(e).slice(8, -1);
}
const Fc = typeof Symbol < "u" ? Symbol.iterator : "@@iterator", U_ = typeof Fc == "symbol" ? function(e) {
  var t;
  return e != null && (t = e[Fc]) && t.apply(e);
} : function() {
  return null;
}, ao = {};
function xn(e) {
  var t, n, r, o;
  if (arguments.length === 1) {
    if (_t(e))
      return e.slice();
    if (this === ao && typeof e == "string")
      return [e];
    if (o = U_(e)) {
      for (n = []; !(r = o.next()).done; )
        n.push(r.value);
      return n;
    }
    if (e == null)
      return [e];
    if (typeof (t = e.length) == "number") {
      for (n = new Array(t); t--; )
        n[t] = e[t];
      return n;
    }
    return [e];
  }
  for (t = arguments.length, n = new Array(t); t--; )
    n[t] = arguments[t];
  return n;
}
const Ju = typeof Symbol < "u" ? (e) => e[Symbol.toStringTag] === "AsyncFunction" : () => !1;
var fn = typeof location < "u" && /^(http|https):\/\/(localhost|127\.0\.0\.1)/.test(location.href);
function Yg(e, t) {
  fn = e, qg = t;
}
var qg = () => !0;
const K_ = !new Error("").stack;
function Zr() {
  if (K_)
    try {
      throw Zr.arguments, new Error();
    } catch (e) {
      return e;
    }
  return new Error();
}
function Bc(e, t) {
  var n = e.stack;
  return n ? (t = t || 0, n.indexOf(e.name) === 0 && (t += (e.name + e.message).split(`
`).length), n.split(`
`).slice(t).filter(qg).map((r) => `
` + r).join("")) : "";
}
var Zg = ["Unknown", "Constraint", "Data", "TransactionInactive", "ReadOnly", "Version", "NotFound", "InvalidState", "InvalidAccess", "Abort", "Timeout", "QuotaExceeded", "Syntax", "DataClone"], Qu = ["Modify", "Bulk", "OpenFailed", "VersionChange", "Schema", "Upgrade", "InvalidTable", "MissingAPI", "NoSuchDatabase", "InvalidArgument", "SubTransaction", "Unsupported", "Internal", "DatabaseClosed", "PrematureCommit", "ForeignAwait"].concat(Zg), G_ = { VersionChanged: "Database version changed by other database connection", DatabaseClosed: "Database has been closed", Abort: "Transaction aborted", TransactionInactive: "Transaction has already completed or failed", MissingAPI: "IndexedDB API missing. Please visit https://tinyurl.com/y2uuvskb" };
function Io(e, t) {
  this._e = Zr(), this.name = e, this.message = t;
}
function Xg(e, t) {
  return e + ". Errors: " + Object.keys(t).map((n) => t[n].toString()).filter((n, r, o) => o.indexOf(n) === r).join(`
`);
}
function Ma(e, t, n, r) {
  this._e = Zr(), this.failures = t, this.failedKeys = r, this.successCount = n, this.message = Xg(e, t);
}
function Ei(e, t) {
  this._e = Zr(), this.name = "BulkError", this.failures = Object.keys(t).map((n) => t[n]), this.failuresByPos = t, this.message = Xg(e, t);
}
_o(Io).from(Error).extend({ stack: { get: function() {
  return this._stack || (this._stack = this.name + ": " + this.message + Bc(this._e, 2));
} }, toString: function() {
  return this.name + ": " + this.message;
} }), _o(Ma).from(Io), _o(Ei).from(Io);
var ed = Qu.reduce((e, t) => (e[t] = t + "Error", e), {});
const Y_ = Io;
var ve = Qu.reduce((e, t) => {
  var n = t + "Error";
  function r(o, i) {
    this._e = Zr(), this.name = n, o ? typeof o == "string" ? (this.message = `${o}${i ? `
 ` + i : ""}`, this.inner = i || null) : typeof o == "object" && (this.message = `${o.name} ${o.message}`, this.inner = o) : (this.message = G_[t] || n, this.inner = null);
  }
  return _o(r).from(Y_), e[t] = r, e;
}, {});
ve.Syntax = SyntaxError, ve.Type = TypeError, ve.Range = RangeError;
var uh = Zg.reduce((e, t) => (e[t + "Error"] = ve[t], e), {}), aa = Qu.reduce((e, t) => (["Syntax", "Type", "Range"].indexOf(t) === -1 && (e[t + "Error"] = ve[t]), e), {});
function je() {
}
function Zi(e) {
  return e;
}
function q_(e, t) {
  return e == null || e === Zi ? t : function(n) {
    return t(e(n));
  };
}
function Hr(e, t) {
  return function() {
    e.apply(this, arguments), t.apply(this, arguments);
  };
}
function Z_(e, t) {
  return e === je ? t : function() {
    var n = e.apply(this, arguments);
    n !== void 0 && (arguments[0] = n);
    var r = this.onsuccess, o = this.onerror;
    this.onsuccess = null, this.onerror = null;
    var i = t.apply(this, arguments);
    return r && (this.onsuccess = this.onsuccess ? Hr(r, this.onsuccess) : r), o && (this.onerror = this.onerror ? Hr(o, this.onerror) : o), i !== void 0 ? i : n;
  };
}
function X_(e, t) {
  return e === je ? t : function() {
    e.apply(this, arguments);
    var n = this.onsuccess, r = this.onerror;
    this.onsuccess = this.onerror = null, t.apply(this, arguments), n && (this.onsuccess = this.onsuccess ? Hr(n, this.onsuccess) : n), r && (this.onerror = this.onerror ? Hr(r, this.onerror) : r);
  };
}
function J_(e, t) {
  return e === je ? t : function(n) {
    var r = e.apply(this, arguments);
    kt(n, r);
    var o = this.onsuccess, i = this.onerror;
    this.onsuccess = null, this.onerror = null;
    var s = t.apply(this, arguments);
    return o && (this.onsuccess = this.onsuccess ? Hr(o, this.onsuccess) : o), i && (this.onerror = this.onerror ? Hr(i, this.onerror) : i), r === void 0 ? s === void 0 ? void 0 : s : kt(r, s);
  };
}
function Q_(e, t) {
  return e === je ? t : function() {
    return t.apply(this, arguments) !== !1 && e.apply(this, arguments);
  };
}
function td(e, t) {
  return e === je ? t : function() {
    var n = e.apply(this, arguments);
    if (n && typeof n.then == "function") {
      for (var r = this, o = arguments.length, i = new Array(o); o--; )
        i[o] = arguments[o];
      return n.then(function() {
        return t.apply(r, i);
      });
    }
    return t.apply(this, arguments);
  };
}
aa.ModifyError = Ma, aa.DexieError = Io, aa.BulkError = Ei;
var Xi = {};
const Jg = 100, [Lc, $a, Vc] = typeof Promise > "u" ? [] : (() => {
  let e = Promise.resolve();
  if (typeof crypto > "u" || !crypto.subtle)
    return [e, qi(e), e];
  const t = crypto.subtle.digest("SHA-512", new Uint8Array([0]));
  return [t, qi(t), e];
})(), Qg = $a && $a.then, la = Lc && Lc.constructor, nd = !!Vc;
var zc = !1, eI = Vc ? () => {
  Vc.then(Hs);
} : Ge.setImmediate ? setImmediate.bind(null, Hs) : Ge.MutationObserver ? () => {
  var e = document.createElement("div");
  new MutationObserver(() => {
    Hs(), e = null;
  }).observe(e, { attributes: !0 }), e.setAttribute("i", "1");
} : () => {
  setTimeout(Hs, 0);
}, _i = function(e, t) {
  pi.push([e, t]), ka && (eI(), ka = !1);
}, jc = !0, ka = !0, kr = [], ca = [], Hc = null, Wc = Zi, No = { id: "global", global: !0, ref: 0, unhandleds: [], onunhandled: hh, pgp: !1, env: {}, finalize: function() {
  this.unhandleds.forEach((e) => {
    try {
      hh(e[0], e[1]);
    } catch {
    }
  });
} }, he = No, pi = [], Rr = 0, ua = [];
function ae(e) {
  if (typeof this != "object")
    throw new TypeError("Promises must be constructed via new");
  this._listeners = [], this.onuncatched = je, this._lib = !1;
  var t = this._PSD = he;
  if (fn && (this._stackHolder = Zr(), this._prev = null, this._numPrev = 0), typeof e != "function") {
    if (e !== Xi)
      throw new TypeError("Not a function");
    return this._state = arguments[1], this._value = arguments[2], void (this._state === !1 && Kc(this, this._value));
  }
  this._state = null, this._value = null, ++t.ref, tv(this, e);
}
const Uc = { get: function() {
  var e = he, t = Ra;
  function n(r, o) {
    var i = !e.global && (e !== he || t !== Ra);
    const s = i && !An();
    var a = new ae((l, c) => {
      rd(this, new ev(Pa(r, e, i, s), Pa(o, e, i, s), l, c, e));
    });
    return fn && ov(a, this), a;
  }
  return n.prototype = Xi, n;
}, set: function(e) {
  In(this, "then", e && e.prototype === Xi ? Uc : { get: function() {
    return e;
  }, set: Uc.set });
} };
function ev(e, t, n, r, o) {
  this.onFulfilled = typeof e == "function" ? e : null, this.onRejected = typeof t == "function" ? t : null, this.resolve = n, this.reject = r, this.psd = o;
}
function tv(e, t) {
  try {
    t((n) => {
      if (e._state === null) {
        if (n === e)
          throw new TypeError("A promise cannot be resolved with itself.");
        var r = e._lib && ys();
        n && typeof n.then == "function" ? tv(e, (o, i) => {
          n instanceof ae ? n._then(o, i) : n.then(o, i);
        }) : (e._state = !0, e._value = n, nv(e)), r && bs();
      }
    }, Kc.bind(null, e));
  } catch (n) {
    Kc(e, n);
  }
}
function Kc(e, t) {
  if (ca.push(t), e._state === null) {
    var n = e._lib && ys();
    t = Wc(t), e._state = !1, e._value = t, fn && t !== null && typeof t == "object" && !t._promise && function(r, o, i) {
      try {
        r.apply(null, i);
      } catch (s) {
        o && o(s);
      }
    }(() => {
      var r = Xu(t, "stack");
      t._promise = e, In(t, "stack", { get: () => zc ? r && (r.get ? r.get.apply(t) : r.value) : e.stack });
    }), function(r) {
      kr.some((o) => o._value === r._value) || kr.push(r);
    }(e), nv(e), n && bs();
  }
}
function nv(e) {
  var t = e._listeners;
  e._listeners = [];
  for (var n = 0, r = t.length; n < r; ++n)
    rd(e, t[n]);
  var o = e._PSD;
  --o.ref || o.finalize(), Rr === 0 && (++Rr, _i(() => {
    --Rr == 0 && od();
  }, []));
}
function rd(e, t) {
  if (e._state !== null) {
    var n = e._state ? t.onFulfilled : t.onRejected;
    if (n === null)
      return (e._state ? t.resolve : t.reject)(e._value);
    ++t.psd.ref, ++Rr, _i(tI, [n, e, t]);
  } else
    e._listeners.push(t);
}
function tI(e, t, n) {
  try {
    Hc = t;
    var r, o = t._value;
    t._state ? r = e(o) : (ca.length && (ca = []), r = e(o), ca.indexOf(o) === -1 && function(i) {
      for (var s = kr.length; s; )
        if (kr[--s]._value === i._value)
          return void kr.splice(s, 1);
    }(t)), n.resolve(r);
  } catch (i) {
    n.reject(i);
  } finally {
    Hc = null, --Rr == 0 && od(), --n.psd.ref || n.psd.finalize();
  }
}
function rv(e, t, n) {
  if (t.length === n)
    return t;
  var r = "";
  if (e._state === !1) {
    var o, i, s = e._value;
    s != null ? (o = s.name || "Error", i = s.message || s, r = Bc(s, 0)) : (o = s, i = ""), t.push(o + (i ? ": " + i : "") + r);
  }
  return fn && ((r = Bc(e._stackHolder, 2)) && t.indexOf(r) === -1 && t.push(r), e._prev && rv(e._prev, t, n)), t;
}
function ov(e, t) {
  var n = t ? t._numPrev + 1 : 0;
  n < 100 && (e._prev = t, e._numPrev = n);
}
function Hs() {
  ys() && bs();
}
function ys() {
  var e = jc;
  return jc = !1, ka = !1, e;
}
function bs() {
  var e, t, n;
  do
    for (; pi.length > 0; )
      for (e = pi, pi = [], n = e.length, t = 0; t < n; ++t) {
        var r = e[t];
        r[0].apply(null, r[1]);
      }
  while (pi.length > 0);
  jc = !0, ka = !0;
}
function od() {
  var e = kr;
  kr = [], e.forEach((r) => {
    r._PSD.onunhandled.call(null, r._value, r);
  });
  for (var t = ua.slice(0), n = t.length; n; )
    t[--n]();
}
function Ws(e) {
  return new ae(Xi, !1, e);
}
function Je(e, t) {
  var n = he;
  return function() {
    var r = ys(), o = he;
    try {
      return ir(n, !0), e.apply(this, arguments);
    } catch (i) {
      t && t(i);
    } finally {
      ir(o, !1), r && bs();
    }
  };
}
$o(ae.prototype, { then: Uc, _then: function(e, t) {
  rd(this, new ev(null, null, e, t, he));
}, catch: function(e) {
  if (arguments.length === 1)
    return this.then(null, e);
  var t = arguments[0], n = arguments[1];
  return typeof t == "function" ? this.then(null, (r) => r instanceof t ? n(r) : Ws(r)) : this.then(null, (r) => r && r.name === t ? n(r) : Ws(r));
}, finally: function(e) {
  return this.then((t) => (e(), t), (t) => (e(), Ws(t)));
}, stack: { get: function() {
  if (this._stack)
    return this._stack;
  try {
    zc = !0;
    var e = rv(this, [], 20).join(`
From previous: `);
    return this._state !== null && (this._stack = e), e;
  } finally {
    zc = !1;
  }
} }, timeout: function(e, t) {
  return e < 1 / 0 ? new ae((n, r) => {
    var o = setTimeout(() => r(new ve.Timeout(t)), e);
    this.then(n, r).finally(clearTimeout.bind(null, o));
  }) : this;
} }), typeof Symbol < "u" && Symbol.toStringTag && In(ae.prototype, Symbol.toStringTag, "Dexie.Promise"), No.env = iv(), $o(ae, { all: function() {
  var e = xn.apply(null, arguments).map(Us);
  return new ae(function(t, n) {
    e.length === 0 && t([]);
    var r = e.length;
    e.forEach((o, i) => ae.resolve(o).then((s) => {
      e[i] = s, --r || t(e);
    }, n));
  });
}, resolve: (e) => {
  if (e instanceof ae)
    return e;
  if (e && typeof e.then == "function")
    return new ae((n, r) => {
      e.then(n, r);
    });
  var t = new ae(Xi, !0, e);
  return ov(t, Hc), t;
}, reject: Ws, race: function() {
  var e = xn.apply(null, arguments).map(Us);
  return new ae((t, n) => {
    e.map((r) => ae.resolve(r).then(t, n));
  });
}, PSD: { get: () => he, set: (e) => he = e }, totalEchoes: { get: () => Ra }, newPSD: or, usePSD: Ko, scheduler: { get: () => _i, set: (e) => {
  _i = e;
} }, rejectionMapper: { get: () => Wc, set: (e) => {
  Wc = e;
} }, follow: (e, t) => new ae((n, r) => or((o, i) => {
  var s = he;
  s.unhandleds = [], s.onunhandled = i, s.finalize = Hr(function() {
    (function(a) {
      function l() {
        a(), ua.splice(ua.indexOf(l), 1);
      }
      ua.push(l), ++Rr, _i(() => {
        --Rr == 0 && od();
      }, []);
    })(() => {
      this.unhandleds.length === 0 ? o() : i(this.unhandleds[0]);
    });
  }, s.finalize), e();
}, t, n, r)) }), la && (la.allSettled && In(ae, "allSettled", function() {
  const e = xn.apply(null, arguments).map(Us);
  return new ae((t) => {
    e.length === 0 && t([]);
    let n = e.length;
    const r = new Array(n);
    e.forEach((o, i) => ae.resolve(o).then((s) => r[i] = { status: "fulfilled", value: s }, (s) => r[i] = { status: "rejected", reason: s }).then(() => --n || t(r)));
  });
}), la.any && typeof AggregateError < "u" && In(ae, "any", function() {
  const e = xn.apply(null, arguments).map(Us);
  return new ae((t, n) => {
    e.length === 0 && n(new AggregateError([]));
    let r = e.length;
    const o = new Array(r);
    e.forEach((i, s) => ae.resolve(i).then((a) => t(a), (a) => {
      o[s] = a, --r || n(new AggregateError(o));
    }));
  });
}));
const St = { awaits: 0, echoes: 0, id: 0 };
var nI = 0, da = [], Ll = 0, Ra = 0, rI = 0;
function or(e, t, n, r) {
  var o = he, i = Object.create(o);
  i.parent = o, i.ref = 0, i.global = !1, i.id = ++rI;
  var s = No.env;
  i.env = nd ? { Promise: ae, PromiseProp: { value: ae, configurable: !0, writable: !0 }, all: ae.all, race: ae.race, allSettled: ae.allSettled, any: ae.any, resolve: ae.resolve, reject: ae.reject, nthen: dh(s.nthen, i), gthen: dh(s.gthen, i) } : {}, t && kt(i, t), ++o.ref, i.finalize = function() {
    --this.parent.ref || this.parent.finalize();
  };
  var a = Ko(i, e, n, r);
  return i.ref === 0 && i.finalize(), a;
}
function Uo() {
  return St.id || (St.id = ++nI), ++St.awaits, St.echoes += Jg, St.id;
}
function An() {
  return !!St.awaits && (--St.awaits == 0 && (St.id = 0), St.echoes = St.awaits * Jg, !0);
}
function Us(e) {
  return St.echoes && e && e.constructor === la ? (Uo(), e.then((t) => (An(), t), (t) => (An(), ft(t)))) : e;
}
function oI(e) {
  ++Ra, St.echoes && --St.echoes != 0 || (St.echoes = St.id = 0), da.push(he), ir(e, !0);
}
function iI() {
  var e = da[da.length - 1];
  da.pop(), ir(e, !1);
}
function ir(e, t) {
  var n = he;
  if ((t ? !St.echoes || Ll++ && e === he : !Ll || --Ll && e === he) || sv(t ? oI.bind(null, e) : iI), e !== he && (he = e, n === No && (No.env = iv()), nd)) {
    var r = No.env.Promise, o = e.env;
    $a.then = o.nthen, r.prototype.then = o.gthen, (n.global || e.global) && (Object.defineProperty(Ge, "Promise", o.PromiseProp), r.all = o.all, r.race = o.race, r.resolve = o.resolve, r.reject = o.reject, o.allSettled && (r.allSettled = o.allSettled), o.any && (r.any = o.any));
  }
}
function iv() {
  var e = Ge.Promise;
  return nd ? { Promise: e, PromiseProp: Object.getOwnPropertyDescriptor(Ge, "Promise"), all: e.all, race: e.race, allSettled: e.allSettled, any: e.any, resolve: e.resolve, reject: e.reject, nthen: $a.then, gthen: e.prototype.then } : {};
}
function Ko(e, t, n, r, o) {
  var i = he;
  try {
    return ir(e, !0), t(n, r, o);
  } finally {
    ir(i, !1);
  }
}
function sv(e) {
  Qg.call(Lc, e);
}
function Pa(e, t, n, r) {
  return typeof e != "function" ? e : function() {
    var o = he;
    n && Uo(), ir(t, !0);
    try {
      return e.apply(this, arguments);
    } finally {
      ir(o, !1), r && sv(An);
    }
  };
}
function dh(e, t) {
  return function(n, r) {
    return e.call(this, Pa(n, t), Pa(r, t));
  };
}
("" + Qg).indexOf("[native code]") === -1 && (Uo = An = je);
const fh = "unhandledrejection";
function hh(e, t) {
  var n;
  try {
    n = t.onuncatched(e);
  } catch {
  }
  if (n !== !1)
    try {
      var r, o = { promise: t, reason: e };
      if (Ge.document && document.createEvent ? ((r = document.createEvent("Event")).initEvent(fh, !0, !0), kt(r, o)) : Ge.CustomEvent && kt(r = new CustomEvent(fh, { detail: o }), o), r && Ge.dispatchEvent && (dispatchEvent(r), !Ge.PromiseRejectionEvent && Ge.onunhandledrejection))
        try {
          Ge.onunhandledrejection(r);
        } catch {
        }
      fn && r && !r.defaultPrevented && console.warn(`Unhandled rejection: ${e.stack || e}`);
    } catch {
    }
}
var ft = ae.reject;
function Gc(e, t, n, r) {
  if (e.idbdb && (e._state.openComplete || he.letThrough || e._vip)) {
    var o = e._createTransaction(t, n, e._dbSchema);
    try {
      o.create(), e._state.PR1398_maxLoop = 3;
    } catch (i) {
      return i.name === ed.InvalidState && e.isOpen() && --e._state.PR1398_maxLoop > 0 ? (console.warn("Dexie: Need to reopen db"), e._close(), e.open().then(() => Gc(e, t, n, r))) : ft(i);
    }
    return o._promise(t, (i, s) => or(() => (he.trans = o, r(i, s, o)))).then((i) => o._completion.then(() => i));
  }
  if (e._state.openComplete)
    return ft(new ve.DatabaseClosed(e._state.dbOpenError));
  if (!e._state.isBeingOpened) {
    if (!e._options.autoOpen)
      return ft(new ve.DatabaseClosed());
    e.open().catch(je);
  }
  return e._state.dbReadyPromise.then(() => Gc(e, t, n, r));
}
const ph = "3.2.4", Er = "￿", Yc = -1 / 0, gn = "Invalid key provided. Keys must be of type string, number, Date or Array<string | number | Date>.", av = "String expected.", Ii = [], bl = typeof navigator < "u" && /(MSIE|Trident|Edge)/.test(navigator.userAgent), sI = bl, aI = bl, lv = (e) => !/(dexie\.js|dexie\.min\.js)/.test(e), Cl = "__dbnames", Vl = "readonly", zl = "readwrite";
function Wr(e, t) {
  return e ? t ? function() {
    return e.apply(this, arguments) && t.apply(this, arguments);
  } : e : t;
}
const cv = { type: 3, lower: -1 / 0, lowerOpen: !1, upper: [[]], upperOpen: !1 };
function Ks(e) {
  return typeof e != "string" || /\./.test(e) ? (t) => t : (t) => (t[e] === void 0 && e in t && delete (t = vs(t))[e], t);
}
let lI = class {
  _trans(t, n, r) {
    const o = this._tx || he.trans, i = this.name;
    function s(l, c, u) {
      if (!u.schema[i])
        throw new ve.NotFound("Table " + i + " not part of transaction");
      return n(u.idbtrans, u);
    }
    const a = ys();
    try {
      return o && o.db === this.db ? o === he.trans ? o._promise(t, s, r) : or(() => o._promise(t, s, r), { trans: o, transless: he.transless || he }) : Gc(this.db, t, [this.name], s);
    } finally {
      a && bs();
    }
  }
  get(t, n) {
    return t && t.constructor === Object ? this.where(t).first(n) : this._trans("readonly", (r) => this.core.get({ trans: r, key: t }).then((o) => this.hook.reading.fire(o))).then(n);
  }
  where(t) {
    if (typeof t == "string")
      return new this.db.WhereClause(this, t);
    if (_t(t))
      return new this.db.WhereClause(this, `[${t.join("+")}]`);
    const n = st(t);
    if (n.length === 1)
      return this.where(n[0]).equals(t[n[0]]);
    const r = this.schema.indexes.concat(this.schema.primKey).filter((c) => c.compound && n.every((u) => c.keyPath.indexOf(u) >= 0) && c.keyPath.every((u) => n.indexOf(u) >= 0))[0];
    if (r && this.db._maxKey !== Er)
      return this.where(r.name).equals(r.keyPath.map((c) => t[c]));
    !r && fn && console.warn(`The query ${JSON.stringify(t)} on ${this.name} would benefit of a compound index [${n.join("+")}]`);
    const { idxByName: o } = this.schema, i = this.db._deps.indexedDB;
    function s(c, u) {
      try {
        return i.cmp(c, u) === 0;
      } catch {
        return !1;
      }
    }
    const [a, l] = n.reduce(([c, u], d) => {
      const f = o[d], m = t[d];
      return [c || f, c || !f ? Wr(u, f && f.multi ? (h) => {
        const p = Nn(h, d);
        return _t(p) && p.some((g) => s(m, g));
      } : (h) => s(m, Nn(h, d))) : u];
    }, [null, null]);
    return a ? this.where(a.name).equals(t[a.keyPath]).filter(l) : r ? this.filter(l) : this.where(n).equals("");
  }
  filter(t) {
    return this.toCollection().and(t);
  }
  count(t) {
    return this.toCollection().count(t);
  }
  offset(t) {
    return this.toCollection().offset(t);
  }
  limit(t) {
    return this.toCollection().limit(t);
  }
  each(t) {
    return this.toCollection().each(t);
  }
  toArray(t) {
    return this.toCollection().toArray(t);
  }
  toCollection() {
    return new this.db.Collection(new this.db.WhereClause(this));
  }
  orderBy(t) {
    return new this.db.Collection(new this.db.WhereClause(this, _t(t) ? `[${t.join("+")}]` : t));
  }
  reverse() {
    return this.toCollection().reverse();
  }
  mapToClass(t) {
    this.schema.mappedClass = t;
    const n = (r) => {
      if (!r)
        return r;
      const o = Object.create(t.prototype);
      for (var i in r)
        if (Vt(r, i))
          try {
            o[i] = r[i];
          } catch {
          }
      return o;
    };
    return this.schema.readHook && this.hook.reading.unsubscribe(this.schema.readHook), this.schema.readHook = n, this.hook("reading", n), t;
  }
  defineClass() {
    return this.mapToClass(function(t) {
      kt(this, t);
    });
  }
  add(t, n) {
    const { auto: r, keyPath: o } = this.schema.primKey;
    let i = t;
    return o && r && (i = Ks(o)(t)), this._trans("readwrite", (s) => this.core.mutate({ trans: s, type: "add", keys: n != null ? [n] : null, values: [i] })).then((s) => s.numFailures ? ae.reject(s.failures[0]) : s.lastResult).then((s) => {
      if (o)
        try {
          Qt(t, o, s);
        } catch {
        }
      return s;
    });
  }
  update(t, n) {
    if (typeof t != "object" || _t(t))
      return this.where(":id").equals(t).modify(n);
    {
      const r = Nn(t, this.schema.primKey.keyPath);
      if (r === void 0)
        return ft(new ve.InvalidArgument("Given object does not contain its primary key"));
      try {
        typeof n != "function" ? st(n).forEach((o) => {
          Qt(t, o, n[o]);
        }) : n(t, { value: t, primKey: r });
      } catch {
      }
      return this.where(":id").equals(r).modify(n);
    }
  }
  put(t, n) {
    const { auto: r, keyPath: o } = this.schema.primKey;
    let i = t;
    return o && r && (i = Ks(o)(t)), this._trans("readwrite", (s) => this.core.mutate({ trans: s, type: "put", values: [i], keys: n != null ? [n] : null })).then((s) => s.numFailures ? ae.reject(s.failures[0]) : s.lastResult).then((s) => {
      if (o)
        try {
          Qt(t, o, s);
        } catch {
        }
      return s;
    });
  }
  delete(t) {
    return this._trans("readwrite", (n) => this.core.mutate({ trans: n, type: "delete", keys: [t] })).then((n) => n.numFailures ? ae.reject(n.failures[0]) : void 0);
  }
  clear() {
    return this._trans("readwrite", (t) => this.core.mutate({ trans: t, type: "deleteRange", range: cv })).then((t) => t.numFailures ? ae.reject(t.failures[0]) : void 0);
  }
  bulkGet(t) {
    return this._trans("readonly", (n) => this.core.getMany({ keys: t, trans: n }).then((r) => r.map((o) => this.hook.reading.fire(o))));
  }
  bulkAdd(t, n, r) {
    const o = Array.isArray(n) ? n : void 0, i = (r = r || (o ? void 0 : n)) ? r.allKeys : void 0;
    return this._trans("readwrite", (s) => {
      const { auto: a, keyPath: l } = this.schema.primKey;
      if (l && o)
        throw new ve.InvalidArgument("bulkAdd(): keys argument invalid on tables with inbound keys");
      if (o && o.length !== t.length)
        throw new ve.InvalidArgument("Arguments objects and keys must have the same length");
      const c = t.length;
      let u = l && a ? t.map(Ks(l)) : t;
      return this.core.mutate({ trans: s, type: "add", keys: o, values: u, wantResults: i }).then(({ numFailures: d, results: f, lastResult: m, failures: h }) => {
        if (d === 0)
          return i ? f : m;
        throw new Ei(`${this.name}.bulkAdd(): ${d} of ${c} operations failed`, h);
      });
    });
  }
  bulkPut(t, n, r) {
    const o = Array.isArray(n) ? n : void 0, i = (r = r || (o ? void 0 : n)) ? r.allKeys : void 0;
    return this._trans("readwrite", (s) => {
      const { auto: a, keyPath: l } = this.schema.primKey;
      if (l && o)
        throw new ve.InvalidArgument("bulkPut(): keys argument invalid on tables with inbound keys");
      if (o && o.length !== t.length)
        throw new ve.InvalidArgument("Arguments objects and keys must have the same length");
      const c = t.length;
      let u = l && a ? t.map(Ks(l)) : t;
      return this.core.mutate({ trans: s, type: "put", keys: o, values: u, wantResults: i }).then(({ numFailures: d, results: f, lastResult: m, failures: h }) => {
        if (d === 0)
          return i ? f : m;
        throw new Ei(`${this.name}.bulkPut(): ${d} of ${c} operations failed`, h);
      });
    });
  }
  bulkDelete(t) {
    const n = t.length;
    return this._trans("readwrite", (r) => this.core.mutate({ trans: r, type: "delete", keys: t })).then(({ numFailures: r, lastResult: o, failures: i }) => {
      if (r === 0)
        return o;
      throw new Ei(`${this.name}.bulkDelete(): ${r} of ${n} operations failed`, i);
    });
  }
};
function Ni(e) {
  var t = {}, n = function(s, a) {
    if (a) {
      for (var l = arguments.length, c = new Array(l - 1); --l; )
        c[l - 1] = arguments[l];
      return t[s].subscribe.apply(null, c), e;
    }
    if (typeof s == "string")
      return t[s];
  };
  n.addEventType = i;
  for (var r = 1, o = arguments.length; r < o; ++r)
    i(arguments[r]);
  return n;
  function i(s, a, l) {
    if (typeof s != "object") {
      var c;
      a || (a = Q_), l || (l = je);
      var u = { subscribers: [], fire: l, subscribe: function(d) {
        u.subscribers.indexOf(d) === -1 && (u.subscribers.push(d), u.fire = a(u.fire, d));
      }, unsubscribe: function(d) {
        u.subscribers = u.subscribers.filter(function(f) {
          return f !== d;
        }), u.fire = u.subscribers.reduce(a, l);
      } };
      return t[s] = n[s] = u, u;
    }
    st(c = s).forEach(function(d) {
      var f = c[d];
      if (_t(f))
        i(d, c[d][0], c[d][1]);
      else {
        if (f !== "asap")
          throw new ve.InvalidArgument("Invalid event config");
        var m = i(d, Zi, function() {
          for (var h = arguments.length, p = new Array(h); h--; )
            p[h] = arguments[h];
          m.subscribers.forEach(function(g) {
            Hg(function() {
              g.apply(null, p);
            });
          });
        });
      }
    });
  }
}
function oi(e, t) {
  return _o(t).from({ prototype: e }), t;
}
function no(e, t) {
  return !(e.filter || e.algorithm || e.or) && (t ? e.justLimit : !e.replayFilter);
}
function jl(e, t) {
  e.filter = Wr(e.filter, t);
}
function Hl(e, t, n) {
  var r = e.replayFilter;
  e.replayFilter = r ? () => Wr(r(), t()) : t, e.justLimit = n && !r;
}
function fa(e, t) {
  if (e.isPrimKey)
    return t.primaryKey;
  const n = t.getIndexByKeyPath(e.index);
  if (!n)
    throw new ve.Schema("KeyPath " + e.index + " on object store " + t.name + " is not indexed");
  return n;
}
function mh(e, t, n) {
  const r = fa(e, t.schema);
  return t.openCursor({ trans: n, values: !e.keysOnly, reverse: e.dir === "prev", unique: !!e.unique, query: { index: r, range: e.range } });
}
function Gs(e, t, n, r) {
  const o = e.replayFilter ? Wr(e.filter, e.replayFilter()) : e.filter;
  if (e.or) {
    const i = {}, s = (a, l, c) => {
      if (!o || o(l, c, (f) => l.stop(f), (f) => l.fail(f))) {
        var u = l.primaryKey, d = "" + u;
        d === "[object ArrayBuffer]" && (d = "" + new Uint8Array(u)), Vt(i, d) || (i[d] = !0, t(a, l, c));
      }
    };
    return Promise.all([e.or._iterate(s, n), gh(mh(e, r, n), e.algorithm, s, !e.keysOnly && e.valueMapper)]);
  }
  return gh(mh(e, r, n), Wr(e.algorithm, o), t, !e.keysOnly && e.valueMapper);
}
function gh(e, t, n, r) {
  var o = Je(r ? (i, s, a) => n(r(i), s, a) : n);
  return e.then((i) => {
    if (i)
      return i.start(() => {
        var s = () => i.continue();
        t && !t(i, (a) => s = a, (a) => {
          i.stop(a), s = je;
        }, (a) => {
          i.fail(a), s = je;
        }) || o(i.value, i, (a) => s = a), s();
      });
  });
}
function At(e, t) {
  try {
    const n = vh(e), r = vh(t);
    if (n !== r)
      return n === "Array" ? 1 : r === "Array" ? -1 : n === "binary" ? 1 : r === "binary" ? -1 : n === "string" ? 1 : r === "string" ? -1 : n === "Date" ? 1 : r !== "Date" ? NaN : -1;
    switch (n) {
      case "number":
      case "Date":
      case "string":
        return e > t ? 1 : e < t ? -1 : 0;
      case "binary":
        return function(o, i) {
          const s = o.length, a = i.length, l = s < a ? s : a;
          for (let c = 0; c < l; ++c)
            if (o[c] !== i[c])
              return o[c] < i[c] ? -1 : 1;
          return s === a ? 0 : s < a ? -1 : 1;
        }(yh(e), yh(t));
      case "Array":
        return function(o, i) {
          const s = o.length, a = i.length, l = s < a ? s : a;
          for (let c = 0; c < l; ++c) {
            const u = At(o[c], i[c]);
            if (u !== 0)
              return u;
          }
          return s === a ? 0 : s < a ? -1 : 1;
        }(e, t);
    }
  } catch {
  }
  return NaN;
}
function vh(e) {
  const t = typeof e;
  if (t !== "object")
    return t;
  if (ArrayBuffer.isView(e))
    return "binary";
  const n = Pc(e);
  return n === "ArrayBuffer" ? "binary" : n;
}
function yh(e) {
  return e instanceof Uint8Array ? e : ArrayBuffer.isView(e) ? new Uint8Array(e.buffer, e.byteOffset, e.byteLength) : new Uint8Array(e);
}
let cI = class {
  _read(t, n) {
    var r = this._ctx;
    return r.error ? r.table._trans(null, ft.bind(null, r.error)) : r.table._trans("readonly", t).then(n);
  }
  _write(t) {
    var n = this._ctx;
    return n.error ? n.table._trans(null, ft.bind(null, n.error)) : n.table._trans("readwrite", t, "locked");
  }
  _addAlgorithm(t) {
    var n = this._ctx;
    n.algorithm = Wr(n.algorithm, t);
  }
  _iterate(t, n) {
    return Gs(this._ctx, t, n, this._ctx.table.core);
  }
  clone(t) {
    var n = Object.create(this.constructor.prototype), r = Object.create(this._ctx);
    return t && kt(r, t), n._ctx = r, n;
  }
  raw() {
    return this._ctx.valueMapper = null, this;
  }
  each(t) {
    var n = this._ctx;
    return this._read((r) => Gs(n, t, r, n.table.core));
  }
  count(t) {
    return this._read((n) => {
      const r = this._ctx, o = r.table.core;
      if (no(r, !0))
        return o.count({ trans: n, query: { index: fa(r, o.schema), range: r.range } }).then((s) => Math.min(s, r.limit));
      var i = 0;
      return Gs(r, () => (++i, !1), n, o).then(() => i);
    }).then(t);
  }
  sortBy(t, n) {
    const r = t.split(".").reverse(), o = r[0], i = r.length - 1;
    function s(c, u) {
      return u ? s(c[r[u]], u - 1) : c[o];
    }
    var a = this._ctx.dir === "next" ? 1 : -1;
    function l(c, u) {
      var d = s(c, i), f = s(u, i);
      return d < f ? -a : d > f ? a : 0;
    }
    return this.toArray(function(c) {
      return c.sort(l);
    }).then(n);
  }
  toArray(t) {
    return this._read((n) => {
      var r = this._ctx;
      if (r.dir === "next" && no(r, !0) && r.limit > 0) {
        const { valueMapper: o } = r, i = fa(r, r.table.core.schema);
        return r.table.core.query({ trans: n, limit: r.limit, values: !0, query: { index: i, range: r.range } }).then(({ result: s }) => o ? s.map(o) : s);
      }
      {
        const o = [];
        return Gs(r, (i) => o.push(i), n, r.table.core).then(() => o);
      }
    }, t);
  }
  offset(t) {
    var n = this._ctx;
    return t <= 0 || (n.offset += t, no(n) ? Hl(n, () => {
      var r = t;
      return (o, i) => r === 0 || (r === 1 ? (--r, !1) : (i(() => {
        o.advance(r), r = 0;
      }), !1));
    }) : Hl(n, () => {
      var r = t;
      return () => --r < 0;
    })), this;
  }
  limit(t) {
    return this._ctx.limit = Math.min(this._ctx.limit, t), Hl(this._ctx, () => {
      var n = t;
      return function(r, o, i) {
        return --n <= 0 && o(i), n >= 0;
      };
    }, !0), this;
  }
  until(t, n) {
    return jl(this._ctx, function(r, o, i) {
      return !t(r.value) || (o(i), n);
    }), this;
  }
  first(t) {
    return this.limit(1).toArray(function(n) {
      return n[0];
    }).then(t);
  }
  last(t) {
    return this.reverse().first(t);
  }
  filter(t) {
    var n, r;
    return jl(this._ctx, function(o) {
      return t(o.value);
    }), n = this._ctx, r = t, n.isMatch = Wr(n.isMatch, r), this;
  }
  and(t) {
    return this.filter(t);
  }
  or(t) {
    return new this.db.WhereClause(this._ctx.table, t, this);
  }
  reverse() {
    return this._ctx.dir = this._ctx.dir === "prev" ? "next" : "prev", this._ondirectionchange && this._ondirectionchange(this._ctx.dir), this;
  }
  desc() {
    return this.reverse();
  }
  eachKey(t) {
    var n = this._ctx;
    return n.keysOnly = !n.isMatch, this.each(function(r, o) {
      t(o.key, o);
    });
  }
  eachUniqueKey(t) {
    return this._ctx.unique = "unique", this.eachKey(t);
  }
  eachPrimaryKey(t) {
    var n = this._ctx;
    return n.keysOnly = !n.isMatch, this.each(function(r, o) {
      t(o.primaryKey, o);
    });
  }
  keys(t) {
    var n = this._ctx;
    n.keysOnly = !n.isMatch;
    var r = [];
    return this.each(function(o, i) {
      r.push(i.key);
    }).then(function() {
      return r;
    }).then(t);
  }
  primaryKeys(t) {
    var n = this._ctx;
    if (n.dir === "next" && no(n, !0) && n.limit > 0)
      return this._read((o) => {
        var i = fa(n, n.table.core.schema);
        return n.table.core.query({ trans: o, values: !1, limit: n.limit, query: { index: i, range: n.range } });
      }).then(({ result: o }) => o).then(t);
    n.keysOnly = !n.isMatch;
    var r = [];
    return this.each(function(o, i) {
      r.push(i.primaryKey);
    }).then(function() {
      return r;
    }).then(t);
  }
  uniqueKeys(t) {
    return this._ctx.unique = "unique", this.keys(t);
  }
  firstKey(t) {
    return this.limit(1).keys(function(n) {
      return n[0];
    }).then(t);
  }
  lastKey(t) {
    return this.reverse().firstKey(t);
  }
  distinct() {
    var t = this._ctx, n = t.index && t.table.schema.idxByName[t.index];
    if (!n || !n.multi)
      return this;
    var r = {};
    return jl(this._ctx, function(o) {
      var i = o.primaryKey.toString(), s = Vt(r, i);
      return r[i] = !0, !s;
    }), this;
  }
  modify(t) {
    var n = this._ctx;
    return this._write((r) => {
      var o;
      if (typeof t == "function")
        o = t;
      else {
        var i = st(t), s = i.length;
        o = function(p) {
          for (var g = !1, v = 0; v < s; ++v) {
            var y = i[v], b = t[y];
            Nn(p, y) !== b && (Qt(p, y, b), g = !0);
          }
          return g;
        };
      }
      const a = n.table.core, { outbound: l, extractKey: c } = a.schema.primaryKey, u = this.db._options.modifyChunkSize || 200, d = [];
      let f = 0;
      const m = [], h = (p, g) => {
        const { failures: v, numFailures: y } = g;
        f += p - y;
        for (let b of st(v))
          d.push(v[b]);
      };
      return this.clone().primaryKeys().then((p) => {
        const g = (v) => {
          const y = Math.min(u, p.length - v);
          return a.getMany({ trans: r, keys: p.slice(v, v + y), cache: "immutable" }).then((b) => {
            const E = [], S = [], T = l ? [] : null, C = [];
            for (let w = 0; w < y; ++w) {
              const R = b[w], O = { value: vs(R), primKey: p[v + w] };
              o.call(O, O.value, O) !== !1 && (O.value == null ? C.push(p[v + w]) : l || At(c(R), c(O.value)) === 0 ? (S.push(O.value), l && T.push(p[v + w])) : (C.push(p[v + w]), E.push(O.value)));
            }
            const _ = no(n) && n.limit === 1 / 0 && (typeof t != "function" || t === Wl) && { index: n.index, range: n.range };
            return Promise.resolve(E.length > 0 && a.mutate({ trans: r, type: "add", values: E }).then((w) => {
              for (let R in w.failures)
                C.splice(parseInt(R), 1);
              h(E.length, w);
            })).then(() => (S.length > 0 || _ && typeof t == "object") && a.mutate({ trans: r, type: "put", keys: T, values: S, criteria: _, changeSpec: typeof t != "function" && t }).then((w) => h(S.length, w))).then(() => (C.length > 0 || _ && t === Wl) && a.mutate({ trans: r, type: "delete", keys: C, criteria: _ }).then((w) => h(C.length, w))).then(() => p.length > v + y && g(v + u));
          });
        };
        return g(0).then(() => {
          if (d.length > 0)
            throw new Ma("Error modifying one or more objects", d, f, m);
          return p.length;
        });
      });
    });
  }
  delete() {
    var t = this._ctx, n = t.range;
    return no(t) && (t.isPrimKey && !aI || n.type === 3) ? this._write((r) => {
      const { primaryKey: o } = t.table.core.schema, i = n;
      return t.table.core.count({ trans: r, query: { index: o, range: i } }).then((s) => t.table.core.mutate({ trans: r, type: "deleteRange", range: i }).then(({ failures: a, lastResult: l, results: c, numFailures: u }) => {
        if (u)
          throw new Ma("Could not delete some values", Object.keys(a).map((d) => a[d]), s - u);
        return s - u;
      }));
    }) : this.modify(Wl);
  }
};
const Wl = (e, t) => t.value = null;
function uI(e, t) {
  return e < t ? -1 : e === t ? 0 : 1;
}
function dI(e, t) {
  return e > t ? -1 : e === t ? 0 : 1;
}
function Bt(e, t, n) {
  var r = e instanceof dv ? new e.Collection(e) : e;
  return r._ctx.error = n ? new n(t) : new TypeError(t), r;
}
function ro(e) {
  return new e.Collection(e, () => uv("")).limit(0);
}
function fI(e, t, n, r, o, i) {
  for (var s = Math.min(e.length, r.length), a = -1, l = 0; l < s; ++l) {
    var c = t[l];
    if (c !== r[l])
      return o(e[l], n[l]) < 0 ? e.substr(0, l) + n[l] + n.substr(l + 1) : o(e[l], r[l]) < 0 ? e.substr(0, l) + r[l] + n.substr(l + 1) : a >= 0 ? e.substr(0, a) + t[a] + n.substr(a + 1) : null;
    o(e[l], c) < 0 && (a = l);
  }
  return s < r.length && i === "next" ? e + n.substr(e.length) : s < e.length && i === "prev" ? e.substr(0, n.length) : a < 0 ? null : e.substr(0, a) + r[a] + n.substr(a + 1);
}
function Ys(e, t, n, r) {
  var o, i, s, a, l, c, u, d = n.length;
  if (!n.every((p) => typeof p == "string"))
    return Bt(e, av);
  function f(p) {
    o = /* @__PURE__ */ function(v) {
      return v === "next" ? (y) => y.toUpperCase() : (y) => y.toLowerCase();
    }(p), i = /* @__PURE__ */ function(v) {
      return v === "next" ? (y) => y.toLowerCase() : (y) => y.toUpperCase();
    }(p), s = p === "next" ? uI : dI;
    var g = n.map(function(v) {
      return { lower: i(v), upper: o(v) };
    }).sort(function(v, y) {
      return s(v.lower, y.lower);
    });
    a = g.map(function(v) {
      return v.upper;
    }), l = g.map(function(v) {
      return v.lower;
    }), c = p, u = p === "next" ? "" : r;
  }
  f("next");
  var m = new e.Collection(e, () => Ln(a[0], l[d - 1] + r));
  m._ondirectionchange = function(p) {
    f(p);
  };
  var h = 0;
  return m._addAlgorithm(function(p, g, v) {
    var y = p.key;
    if (typeof y != "string")
      return !1;
    var b = i(y);
    if (t(b, l, h))
      return !0;
    for (var E = null, S = h; S < d; ++S) {
      var T = fI(y, b, a[S], l[S], s, c);
      T === null && E === null ? h = S + 1 : (E === null || s(E, T) > 0) && (E = T);
    }
    return g(E !== null ? function() {
      p.continue(E + u);
    } : v), !1;
  }), m;
}
function Ln(e, t, n, r) {
  return { type: 2, lower: e, upper: t, lowerOpen: n, upperOpen: r };
}
function uv(e) {
  return { type: 1, lower: e, upper: e };
}
let dv = class {
  get Collection() {
    return this._ctx.table.db.Collection;
  }
  between(t, n, r, o) {
    r = r !== !1, o = o === !0;
    try {
      return this._cmp(t, n) > 0 || this._cmp(t, n) === 0 && (r || o) && (!r || !o) ? ro(this) : new this.Collection(this, () => Ln(t, n, !r, !o));
    } catch {
      return Bt(this, gn);
    }
  }
  equals(t) {
    return t == null ? Bt(this, gn) : new this.Collection(this, () => uv(t));
  }
  above(t) {
    return t == null ? Bt(this, gn) : new this.Collection(this, () => Ln(t, void 0, !0));
  }
  aboveOrEqual(t) {
    return t == null ? Bt(this, gn) : new this.Collection(this, () => Ln(t, void 0, !1));
  }
  below(t) {
    return t == null ? Bt(this, gn) : new this.Collection(this, () => Ln(void 0, t, !1, !0));
  }
  belowOrEqual(t) {
    return t == null ? Bt(this, gn) : new this.Collection(this, () => Ln(void 0, t));
  }
  startsWith(t) {
    return typeof t != "string" ? Bt(this, av) : this.between(t, t + Er, !0, !0);
  }
  startsWithIgnoreCase(t) {
    return t === "" ? this.startsWith(t) : Ys(this, (n, r) => n.indexOf(r[0]) === 0, [t], Er);
  }
  equalsIgnoreCase(t) {
    return Ys(this, (n, r) => n === r[0], [t], "");
  }
  anyOfIgnoreCase() {
    var t = xn.apply(ao, arguments);
    return t.length === 0 ? ro(this) : Ys(this, (n, r) => r.indexOf(n) !== -1, t, "");
  }
  startsWithAnyOfIgnoreCase() {
    var t = xn.apply(ao, arguments);
    return t.length === 0 ? ro(this) : Ys(this, (n, r) => r.some((o) => n.indexOf(o) === 0), t, Er);
  }
  anyOf() {
    const t = xn.apply(ao, arguments);
    let n = this._cmp;
    try {
      t.sort(n);
    } catch {
      return Bt(this, gn);
    }
    if (t.length === 0)
      return ro(this);
    const r = new this.Collection(this, () => Ln(t[0], t[t.length - 1]));
    r._ondirectionchange = (i) => {
      n = i === "next" ? this._ascending : this._descending, t.sort(n);
    };
    let o = 0;
    return r._addAlgorithm((i, s, a) => {
      const l = i.key;
      for (; n(l, t[o]) > 0; )
        if (++o, o === t.length)
          return s(a), !1;
      return n(l, t[o]) === 0 || (s(() => {
        i.continue(t[o]);
      }), !1);
    }), r;
  }
  notEqual(t) {
    return this.inAnyRange([[Yc, t], [t, this.db._maxKey]], { includeLowers: !1, includeUppers: !1 });
  }
  noneOf() {
    const t = xn.apply(ao, arguments);
    if (t.length === 0)
      return new this.Collection(this);
    try {
      t.sort(this._ascending);
    } catch {
      return Bt(this, gn);
    }
    const n = t.reduce((r, o) => r ? r.concat([[r[r.length - 1][1], o]]) : [[Yc, o]], null);
    return n.push([t[t.length - 1], this.db._maxKey]), this.inAnyRange(n, { includeLowers: !1, includeUppers: !1 });
  }
  inAnyRange(t, n) {
    const r = this._cmp, o = this._ascending, i = this._descending, s = this._min, a = this._max;
    if (t.length === 0)
      return ro(this);
    if (!t.every((y) => y[0] !== void 0 && y[1] !== void 0 && o(y[0], y[1]) <= 0))
      return Bt(this, "First argument to inAnyRange() must be an Array of two-value Arrays [lower,upper] where upper must not be lower than lower", ve.InvalidArgument);
    const l = !n || n.includeLowers !== !1, c = n && n.includeUppers === !0;
    let u, d = o;
    function f(y, b) {
      return d(y[0], b[0]);
    }
    try {
      u = t.reduce(function(y, b) {
        let E = 0, S = y.length;
        for (; E < S; ++E) {
          const T = y[E];
          if (r(b[0], T[1]) < 0 && r(b[1], T[0]) > 0) {
            T[0] = s(T[0], b[0]), T[1] = a(T[1], b[1]);
            break;
          }
        }
        return E === S && y.push(b), y;
      }, []), u.sort(f);
    } catch {
      return Bt(this, gn);
    }
    let m = 0;
    const h = c ? (y) => o(y, u[m][1]) > 0 : (y) => o(y, u[m][1]) >= 0, p = l ? (y) => i(y, u[m][0]) > 0 : (y) => i(y, u[m][0]) >= 0;
    let g = h;
    const v = new this.Collection(this, () => Ln(u[0][0], u[u.length - 1][1], !l, !c));
    return v._ondirectionchange = (y) => {
      y === "next" ? (g = h, d = o) : (g = p, d = i), u.sort(f);
    }, v._addAlgorithm((y, b, E) => {
      for (var S = y.key; g(S); )
        if (++m, m === u.length)
          return b(E), !1;
      return !!function(T) {
        return !h(T) && !p(T);
      }(S) || (this._cmp(S, u[m][1]) === 0 || this._cmp(S, u[m][0]) === 0 || b(() => {
        d === o ? y.continue(u[m][0]) : y.continue(u[m][1]);
      }), !1);
    }), v;
  }
  startsWithAnyOf() {
    const t = xn.apply(ao, arguments);
    return t.every((n) => typeof n == "string") ? t.length === 0 ? ro(this) : this.inAnyRange(t.map((n) => [n, n + Er])) : Bt(this, "startsWithAnyOf() only works with strings");
  }
};
function ln(e) {
  return Je(function(t) {
    return Ji(t), e(t.target.error), !1;
  });
}
function Ji(e) {
  e.stopPropagation && e.stopPropagation(), e.preventDefault && e.preventDefault();
}
const Qi = "storagemutated", Kn = "x-storagemutated-1", sr = Ni(null, Qi);
let hI = class {
  _lock() {
    return hi(!he.global), ++this._reculock, this._reculock !== 1 || he.global || (he.lockOwnerFor = this), this;
  }
  _unlock() {
    if (hi(!he.global), --this._reculock == 0)
      for (he.global || (he.lockOwnerFor = null); this._blockedFuncs.length > 0 && !this._locked(); ) {
        var t = this._blockedFuncs.shift();
        try {
          Ko(t[1], t[0]);
        } catch {
        }
      }
    return this;
  }
  _locked() {
    return this._reculock && he.lockOwnerFor !== this;
  }
  create(t) {
    if (!this.mode)
      return this;
    const n = this.db.idbdb, r = this.db._state.dbOpenError;
    if (hi(!this.idbtrans), !t && !n)
      switch (r && r.name) {
        case "DatabaseClosedError":
          throw new ve.DatabaseClosed(r);
        case "MissingAPIError":
          throw new ve.MissingAPI(r.message, r);
        default:
          throw new ve.OpenFailed(r);
      }
    if (!this.active)
      throw new ve.TransactionInactive();
    return hi(this._completion._state === null), (t = this.idbtrans = t || (this.db.core ? this.db.core.transaction(this.storeNames, this.mode, { durability: this.chromeTransactionDurability }) : n.transaction(this.storeNames, this.mode, { durability: this.chromeTransactionDurability }))).onerror = Je((o) => {
      Ji(o), this._reject(t.error);
    }), t.onabort = Je((o) => {
      Ji(o), this.active && this._reject(new ve.Abort(t.error)), this.active = !1, this.on("abort").fire(o);
    }), t.oncomplete = Je(() => {
      this.active = !1, this._resolve(), "mutatedParts" in t && sr.storagemutated.fire(t.mutatedParts);
    }), this;
  }
  _promise(t, n, r) {
    if (t === "readwrite" && this.mode !== "readwrite")
      return ft(new ve.ReadOnly("Transaction is readonly"));
    if (!this.active)
      return ft(new ve.TransactionInactive());
    if (this._locked())
      return new ae((i, s) => {
        this._blockedFuncs.push([() => {
          this._promise(t, n, r).then(i, s);
        }, he]);
      });
    if (r)
      return or(() => {
        var i = new ae((s, a) => {
          this._lock();
          const l = n(s, a, this);
          l && l.then && l.then(s, a);
        });
        return i.finally(() => this._unlock()), i._lib = !0, i;
      });
    var o = new ae((i, s) => {
      var a = n(i, s, this);
      a && a.then && a.then(i, s);
    });
    return o._lib = !0, o;
  }
  _root() {
    return this.parent ? this.parent._root() : this;
  }
  waitFor(t) {
    var n = this._root();
    const r = ae.resolve(t);
    if (n._waitingFor)
      n._waitingFor = n._waitingFor.then(() => r);
    else {
      n._waitingFor = r, n._waitingQueue = [];
      var o = n.idbtrans.objectStore(n.storeNames[0]);
      (function s() {
        for (++n._spinCount; n._waitingQueue.length; )
          n._waitingQueue.shift()();
        n._waitingFor && (o.get(-1 / 0).onsuccess = s);
      })();
    }
    var i = n._waitingFor;
    return new ae((s, a) => {
      r.then((l) => n._waitingQueue.push(Je(s.bind(null, l))), (l) => n._waitingQueue.push(Je(a.bind(null, l)))).finally(() => {
        n._waitingFor === i && (n._waitingFor = null);
      });
    });
  }
  abort() {
    this.active && (this.active = !1, this.idbtrans && this.idbtrans.abort(), this._reject(new ve.Abort()));
  }
  table(t) {
    const n = this._memoizedTables || (this._memoizedTables = {});
    if (Vt(n, t))
      return n[t];
    const r = this.schema[t];
    if (!r)
      throw new ve.NotFound("Table " + t + " not part of transaction");
    const o = new this.db.Table(t, r, this);
    return o.core = this.db.core.table(t), n[t] = o, o;
  }
};
function qc(e, t, n, r, o, i, s) {
  return { name: e, keyPath: t, unique: n, multi: r, auto: o, compound: i, src: (n && !s ? "&" : "") + (r ? "*" : "") + (o ? "++" : "") + fv(t) };
}
function fv(e) {
  return typeof e == "string" ? e : e ? "[" + [].join.call(e, "+") + "]" : "";
}
function hv(e, t, n) {
  return { name: e, primKey: t, indexes: n, mappedClass: null, idxByName: Wg(n, (r) => [r.name, r]) };
}
let es = (e) => {
  try {
    return e.only([[]]), es = () => [[]], [[]];
  } catch {
    return es = () => Er, Er;
  }
};
function Zc(e) {
  return e == null ? () => {
  } : typeof e == "string" ? function(t) {
    return t.split(".").length === 1 ? (r) => r[t] : (r) => Nn(r, t);
  }(e) : (t) => Nn(t, e);
}
function bh(e) {
  return [].slice.call(e);
}
let pI = 0;
function Ti(e) {
  return e == null ? ":id" : typeof e == "string" ? e : `[${e.join("+")}]`;
}
function mI(e, t, n) {
  function r(l) {
    if (l.type === 3)
      return null;
    if (l.type === 4)
      throw new Error("Cannot convert never type to IDBKeyRange");
    const { lower: c, upper: u, lowerOpen: d, upperOpen: f } = l;
    return c === void 0 ? u === void 0 ? null : t.upperBound(u, !!f) : u === void 0 ? t.lowerBound(c, !!d) : t.bound(c, u, !!d, !!f);
  }
  const { schema: o, hasGetAll: i } = function(l, c) {
    const u = bh(l.objectStoreNames);
    return { schema: { name: l.name, tables: u.map((d) => c.objectStore(d)).map((d) => {
      const { keyPath: f, autoIncrement: m } = d, h = _t(f), p = f == null, g = {}, v = { name: d.name, primaryKey: { name: null, isPrimaryKey: !0, outbound: p, compound: h, keyPath: f, autoIncrement: m, unique: !0, extractKey: Zc(f) }, indexes: bh(d.indexNames).map((y) => d.index(y)).map((y) => {
        const { name: b, unique: E, multiEntry: S, keyPath: T } = y, C = { name: b, compound: _t(T), keyPath: T, unique: E, multiEntry: S, extractKey: Zc(T) };
        return g[Ti(T)] = C, C;
      }), getIndexByKeyPath: (y) => g[Ti(y)] };
      return g[":id"] = v.primaryKey, f != null && (g[Ti(f)] = v.primaryKey), v;
    }) }, hasGetAll: u.length > 0 && "getAll" in c.objectStore(u[0]) && !(typeof navigator < "u" && /Safari/.test(navigator.userAgent) && !/(Chrome\/|Edge\/)/.test(navigator.userAgent) && [].concat(navigator.userAgent.match(/Safari\/(\d*)/))[1] < 604) };
  }(e, n), s = o.tables.map((l) => function(c) {
    const u = c.name;
    return { name: u, schema: c, mutate: function({ trans: d, type: f, keys: m, values: h, range: p }) {
      return new Promise((g, v) => {
        g = Je(g);
        const y = d.objectStore(u), b = y.keyPath == null, E = f === "put" || f === "add";
        if (!E && f !== "delete" && f !== "deleteRange")
          throw new Error("Invalid operation type: " + f);
        const { length: S } = m || h || { length: 1 };
        if (m && h && m.length !== h.length)
          throw new Error("Given keys array must have same length as given values array.");
        if (S === 0)
          return g({ numFailures: 0, failures: {}, results: [], lastResult: void 0 });
        let T;
        const C = [], _ = [];
        let w = 0;
        const R = (I) => {
          ++w, Ji(I);
        };
        if (f === "deleteRange") {
          if (p.type === 4)
            return g({ numFailures: w, failures: _, results: [], lastResult: void 0 });
          p.type === 3 ? C.push(T = y.clear()) : C.push(T = y.delete(r(p)));
        } else {
          const [I, L] = E ? b ? [h, m] : [h, null] : [m, null];
          if (E)
            for (let D = 0; D < S; ++D)
              C.push(T = L && L[D] !== void 0 ? y[f](I[D], L[D]) : y[f](I[D])), T.onerror = R;
          else
            for (let D = 0; D < S; ++D)
              C.push(T = y[f](I[D])), T.onerror = R;
        }
        const O = (I) => {
          const L = I.target.result;
          C.forEach((D, P) => D.error != null && (_[P] = D.error)), g({ numFailures: w, failures: _, results: f === "delete" ? m : C.map((D) => D.result), lastResult: L });
        };
        T.onerror = (I) => {
          R(I), O(I);
        }, T.onsuccess = O;
      });
    }, getMany: ({ trans: d, keys: f }) => new Promise((m, h) => {
      m = Je(m);
      const p = d.objectStore(u), g = f.length, v = new Array(g);
      let y, b = 0, E = 0;
      const S = (C) => {
        const _ = C.target;
        v[_._pos] = _.result, ++E === b && m(v);
      }, T = ln(h);
      for (let C = 0; C < g; ++C)
        f[C] != null && (y = p.get(f[C]), y._pos = C, y.onsuccess = S, y.onerror = T, ++b);
      b === 0 && m(v);
    }), get: ({ trans: d, key: f }) => new Promise((m, h) => {
      m = Je(m);
      const p = d.objectStore(u).get(f);
      p.onsuccess = (g) => m(g.target.result), p.onerror = ln(h);
    }), query: /* @__PURE__ */ function(d) {
      return (f) => new Promise((m, h) => {
        m = Je(m);
        const { trans: p, values: g, limit: v, query: y } = f, b = v === 1 / 0 ? void 0 : v, { index: E, range: S } = y, T = p.objectStore(u), C = E.isPrimaryKey ? T : T.index(E.name), _ = r(S);
        if (v === 0)
          return m({ result: [] });
        if (d) {
          const w = g ? C.getAll(_, b) : C.getAllKeys(_, b);
          w.onsuccess = (R) => m({ result: R.target.result }), w.onerror = ln(h);
        } else {
          let w = 0;
          const R = g || !("openKeyCursor" in C) ? C.openCursor(_) : C.openKeyCursor(_), O = [];
          R.onsuccess = (I) => {
            const L = R.result;
            return L ? (O.push(g ? L.value : L.primaryKey), ++w === v ? m({ result: O }) : void L.continue()) : m({ result: O });
          }, R.onerror = ln(h);
        }
      });
    }(i), openCursor: function({ trans: d, values: f, query: m, reverse: h, unique: p }) {
      return new Promise((g, v) => {
        g = Je(g);
        const { index: y, range: b } = m, E = d.objectStore(u), S = y.isPrimaryKey ? E : E.index(y.name), T = h ? p ? "prevunique" : "prev" : p ? "nextunique" : "next", C = f || !("openKeyCursor" in S) ? S.openCursor(r(b), T) : S.openKeyCursor(r(b), T);
        C.onerror = ln(v), C.onsuccess = Je((_) => {
          const w = C.result;
          if (!w)
            return void g(null);
          w.___id = ++pI, w.done = !1;
          const R = w.continue.bind(w);
          let O = w.continuePrimaryKey;
          O && (O = O.bind(w));
          const I = w.advance.bind(w), L = () => {
            throw new Error("Cursor not stopped");
          };
          w.trans = d, w.stop = w.continue = w.continuePrimaryKey = w.advance = () => {
            throw new Error("Cursor not started");
          }, w.fail = Je(v), w.next = function() {
            let D = 1;
            return this.start(() => D-- ? this.continue() : this.stop()).then(() => this);
          }, w.start = (D) => {
            const P = new Promise((N, $) => {
              N = Je(N), C.onerror = ln($), w.fail = $, w.stop = (B) => {
                w.stop = w.continue = w.continuePrimaryKey = w.advance = L, N(B);
              };
            }), k = () => {
              if (C.result)
                try {
                  D();
                } catch (N) {
                  w.fail(N);
                }
              else
                w.done = !0, w.start = () => {
                  throw new Error("Cursor behind last entry");
                }, w.stop();
            };
            return C.onsuccess = Je((N) => {
              C.onsuccess = k, k();
            }), w.continue = R, w.continuePrimaryKey = O, w.advance = I, k(), P;
          }, g(w);
        }, v);
      });
    }, count({ query: d, trans: f }) {
      const { index: m, range: h } = d;
      return new Promise((p, g) => {
        const v = f.objectStore(u), y = m.isPrimaryKey ? v : v.index(m.name), b = r(h), E = b ? y.count(b) : y.count();
        E.onsuccess = Je((S) => p(S.target.result)), E.onerror = ln(g);
      });
    } };
  }(l)), a = {};
  return s.forEach((l) => a[l.name] = l), { stack: "dbcore", transaction: e.transaction.bind(e), table(l) {
    if (!a[l])
      throw new Error(`Table '${l}' not found`);
    return a[l];
  }, MIN_KEY: -1 / 0, MAX_KEY: es(t), schema: o };
}
function Xc({ _novip: e }, t) {
  const n = t.db, r = function(o, i, { IDBKeyRange: s, indexedDB: a }, l) {
    return { dbcore: function(u, d) {
      return d.reduce((f, { create: m }) => ({ ...f, ...m(f) }), u);
    }(mI(i, s, l), o.dbcore) };
  }(e._middlewares, n, e._deps, t);
  e.core = r.dbcore, e.tables.forEach((o) => {
    const i = o.name;
    e.core.schema.tables.some((s) => s.name === i) && (o.core = e.core.table(i), e[i] instanceof e.Table && (e[i].core = o.core));
  });
}
function Fa({ _novip: e }, t, n, r) {
  n.forEach((o) => {
    const i = r[o];
    t.forEach((s) => {
      const a = Xu(s, o);
      (!a || "value" in a && a.value === void 0) && (s === e.Transaction.prototype || s instanceof e.Transaction ? In(s, o, { get() {
        return this.table(o);
      }, set(l) {
        zg(this, o, { value: l, writable: !0, configurable: !0, enumerable: !0 });
      } }) : s[o] = new e.Table(o, i));
    });
  });
}
function Jc({ _novip: e }, t) {
  t.forEach((n) => {
    for (let r in n)
      n[r] instanceof e.Table && delete n[r];
  });
}
function gI(e, t) {
  return e._cfg.version - t._cfg.version;
}
function vI(e, t, n, r) {
  const o = e._dbSchema, i = e._createTransaction("readwrite", e._storeNames, o);
  i.create(n), i._completion.catch(r);
  const s = i._reject.bind(i), a = he.transless || he;
  or(() => {
    he.trans = i, he.transless = a, t === 0 ? (st(o).forEach((l) => {
      Ul(n, l, o[l].primKey, o[l].indexes);
    }), Xc(e, n), ae.follow(() => e.on.populate.fire(i)).catch(s)) : function({ _novip: l }, c, u, d) {
      const f = [], m = l._versions;
      let h = l._dbSchema = eu(l, l.idbdb, d), p = !1;
      const g = m.filter((y) => y._cfg.version >= c);
      function v() {
        return f.length ? ae.resolve(f.shift()(u.idbtrans)).then(v) : ae.resolve();
      }
      return g.forEach((y) => {
        f.push(() => {
          const b = h, E = y._cfg.dbschema;
          tu(l, b, d), tu(l, E, d), h = l._dbSchema = E;
          const S = pv(b, E);
          S.add.forEach((C) => {
            Ul(d, C[0], C[1].primKey, C[1].indexes);
          }), S.change.forEach((C) => {
            if (C.recreate)
              throw new ve.Upgrade("Not yet support for changing primary key");
            {
              const _ = d.objectStore(C.name);
              C.add.forEach((w) => Qc(_, w)), C.change.forEach((w) => {
                _.deleteIndex(w.name), Qc(_, w);
              }), C.del.forEach((w) => _.deleteIndex(w));
            }
          });
          const T = y._cfg.contentUpgrade;
          if (T && y._cfg.version > c) {
            Xc(l, d), u._memoizedTables = {}, p = !0;
            let C = Ug(E);
            S.del.forEach((O) => {
              C[O] = b[O];
            }), Jc(l, [l.Transaction.prototype]), Fa(l, [l.Transaction.prototype], st(C), C), u.schema = C;
            const _ = Ju(T);
            let w;
            _ && Uo();
            const R = ae.follow(() => {
              if (w = T(u), w && _) {
                var O = An.bind(null, null);
                w.then(O, O);
              }
            });
            return w && typeof w.then == "function" ? ae.resolve(w) : R.then(() => w);
          }
        }), f.push((b) => {
          (!p || !sI) && function(E, S) {
            [].slice.call(S.db.objectStoreNames).forEach((T) => E[T] == null && S.db.deleteObjectStore(T));
          }(y._cfg.dbschema, b), Jc(l, [l.Transaction.prototype]), Fa(l, [l.Transaction.prototype], l._storeNames, l._dbSchema), u.schema = l._dbSchema;
        });
      }), v().then(() => {
        var y, b;
        b = d, st(y = h).forEach((E) => {
          b.db.objectStoreNames.contains(E) || Ul(b, E, y[E].primKey, y[E].indexes);
        });
      });
    }(e, t, i, n).catch(s);
  });
}
function pv(e, t) {
  const n = { del: [], add: [], change: [] };
  let r;
  for (r in e)
    t[r] || n.del.push(r);
  for (r in t) {
    const o = e[r], i = t[r];
    if (o) {
      const s = { name: r, def: i, recreate: !1, del: [], add: [], change: [] };
      if ("" + (o.primKey.keyPath || "") != "" + (i.primKey.keyPath || "") || o.primKey.auto !== i.primKey.auto && !bl)
        s.recreate = !0, n.change.push(s);
      else {
        const a = o.idxByName, l = i.idxByName;
        let c;
        for (c in a)
          l[c] || s.del.push(c);
        for (c in l) {
          const u = a[c], d = l[c];
          u ? u.src !== d.src && s.change.push(d) : s.add.push(d);
        }
        (s.del.length > 0 || s.add.length > 0 || s.change.length > 0) && n.change.push(s);
      }
    } else
      n.add.push([r, i]);
  }
  return n;
}
function Ul(e, t, n, r) {
  const o = e.db.createObjectStore(t, n.keyPath ? { keyPath: n.keyPath, autoIncrement: n.auto } : { autoIncrement: n.auto });
  return r.forEach((i) => Qc(o, i)), o;
}
function Qc(e, t) {
  e.createIndex(t.name, t.keyPath, { unique: t.unique, multiEntry: t.multi });
}
function eu(e, t, n) {
  const r = {};
  return Da(t.objectStoreNames, 0).forEach((o) => {
    const i = n.objectStore(o);
    let s = i.keyPath;
    const a = qc(fv(s), s || "", !1, !1, !!i.autoIncrement, s && typeof s != "string", !0), l = [];
    for (let u = 0; u < i.indexNames.length; ++u) {
      const d = i.index(i.indexNames[u]);
      s = d.keyPath;
      var c = qc(d.name, s, !!d.unique, !!d.multiEntry, !1, s && typeof s != "string", !1);
      l.push(c);
    }
    r[o] = hv(o, a, l);
  }), r;
}
function tu({ _novip: e }, t, n) {
  const r = n.db.objectStoreNames;
  for (let o = 0; o < r.length; ++o) {
    const i = r[o], s = n.objectStore(i);
    e._hasGetAll = "getAll" in s;
    for (let a = 0; a < s.indexNames.length; ++a) {
      const l = s.indexNames[a], c = s.index(l).keyPath, u = typeof c == "string" ? c : "[" + Da(c).join("+") + "]";
      if (t[i]) {
        const d = t[i].idxByName[u];
        d && (d.name = l, delete t[i].idxByName[u], t[i].idxByName[l] = d);
      }
    }
  }
  typeof navigator < "u" && /Safari/.test(navigator.userAgent) && !/(Chrome\/|Edge\/)/.test(navigator.userAgent) && Ge.WorkerGlobalScope && Ge instanceof Ge.WorkerGlobalScope && [].concat(navigator.userAgent.match(/Safari\/(\d*)/))[1] < 604 && (e._hasGetAll = !1);
}
let yI = class {
  _parseStoresSpec(t, n) {
    st(t).forEach((r) => {
      if (t[r] !== null) {
        var o = t[r].split(",").map((s, a) => {
          const l = (s = s.trim()).replace(/([&*]|\+\+)/g, ""), c = /^\[/.test(l) ? l.match(/^\[(.*)\]$/)[1].split("+") : l;
          return qc(l, c || null, /\&/.test(s), /\*/.test(s), /\+\+/.test(s), _t(c), a === 0);
        }), i = o.shift();
        if (i.multi)
          throw new ve.Schema("Primary key cannot be multi-valued");
        o.forEach((s) => {
          if (s.auto)
            throw new ve.Schema("Only primary key can be marked as autoIncrement (++)");
          if (!s.keyPath)
            throw new ve.Schema("Index must have a name and cannot be an empty string");
        }), n[r] = hv(r, i, o);
      }
    });
  }
  stores(t) {
    const n = this.db;
    this._cfg.storesSource = this._cfg.storesSource ? kt(this._cfg.storesSource, t) : t;
    const r = n._versions, o = {};
    let i = {};
    return r.forEach((s) => {
      kt(o, s._cfg.storesSource), i = s._cfg.dbschema = {}, s._parseStoresSpec(o, i);
    }), n._dbSchema = i, Jc(n, [n._allTables, n, n.Transaction.prototype]), Fa(n, [n._allTables, n, n.Transaction.prototype, this._cfg.tables], st(i), i), n._storeNames = st(i), this;
  }
  upgrade(t) {
    return this._cfg.contentUpgrade = td(this._cfg.contentUpgrade || je, t), this;
  }
};
function id(e, t) {
  let n = e._dbNamesDB;
  return n || (n = e._dbNamesDB = new Pr(Cl, { addons: [], indexedDB: e, IDBKeyRange: t }), n.version(1).stores({ dbnames: "name" })), n.table("dbnames");
}
function sd(e) {
  return e && typeof e.databases == "function";
}
function nu(e) {
  return or(function() {
    return he.letThrough = !0, e();
  });
}
function bI() {
  var e;
  return !navigator.userAgentData && /Safari\//.test(navigator.userAgent) && !/Chrom(e|ium)\//.test(navigator.userAgent) && indexedDB.databases ? new Promise(function(t) {
    var n = function() {
      return indexedDB.databases().finally(t);
    };
    e = setInterval(n, 100), n();
  }).finally(function() {
    return clearInterval(e);
  }) : Promise.resolve();
}
function CI(e) {
  const t = e._state, { indexedDB: n } = e._deps;
  if (t.isBeingOpened || e.idbdb)
    return t.dbReadyPromise.then(() => t.dbOpenError ? ft(t.dbOpenError) : e);
  fn && (t.openCanceller._stackHolder = Zr()), t.isBeingOpened = !0, t.dbOpenError = null, t.openComplete = !1;
  const r = t.openCanceller;
  function o() {
    if (t.openCanceller !== r)
      throw new ve.DatabaseClosed("db.open() was cancelled");
  }
  let i = t.dbReadyResolve, s = null, a = !1;
  return ae.race([r, (typeof navigator > "u" ? ae.resolve() : bI()).then(() => new ae((l, c) => {
    if (o(), !n)
      throw new ve.MissingAPI();
    const u = e.name, d = t.autoSchema ? n.open(u) : n.open(u, Math.round(10 * e.verno));
    if (!d)
      throw new ve.MissingAPI();
    d.onerror = ln(c), d.onblocked = Je(e._fireOnBlocked), d.onupgradeneeded = Je((f) => {
      if (s = d.transaction, t.autoSchema && !e._options.allowEmptyDB) {
        d.onerror = Ji, s.abort(), d.result.close();
        const h = n.deleteDatabase(u);
        h.onsuccess = h.onerror = Je(() => {
          c(new ve.NoSuchDatabase(`Database ${u} doesnt exist`));
        });
      } else {
        s.onerror = ln(c);
        var m = f.oldVersion > Math.pow(2, 62) ? 0 : f.oldVersion;
        a = m < 1, e._novip.idbdb = d.result, vI(e, m / 10, s, c);
      }
    }, c), d.onsuccess = Je(() => {
      s = null;
      const f = e._novip.idbdb = d.result, m = Da(f.objectStoreNames);
      if (m.length > 0)
        try {
          const p = f.transaction((h = m).length === 1 ? h[0] : h, "readonly");
          t.autoSchema ? function({ _novip: g }, v, y) {
            g.verno = v.version / 10;
            const b = g._dbSchema = eu(0, v, y);
            g._storeNames = Da(v.objectStoreNames, 0), Fa(g, [g._allTables], st(b), b);
          }(e, f, p) : (tu(e, e._dbSchema, p), function(g, v) {
            const y = pv(eu(0, g.idbdb, v), g._dbSchema);
            return !(y.add.length || y.change.some((b) => b.add.length || b.change.length));
          }(e, p) || console.warn("Dexie SchemaDiff: Schema was extended without increasing the number passed to db.version(). Some queries may fail.")), Xc(e, p);
        } catch {
        }
      var h;
      Ii.push(e), f.onversionchange = Je((p) => {
        t.vcFired = !0, e.on("versionchange").fire(p);
      }), f.onclose = Je((p) => {
        e.on("close").fire(p);
      }), a && function({ indexedDB: p, IDBKeyRange: g }, v) {
        !sd(p) && v !== Cl && id(p, g).put({ name: v }).catch(je);
      }(e._deps, u), l();
    }, c);
  }))]).then(() => (o(), t.onReadyBeingFired = [], ae.resolve(nu(() => e.on.ready.fire(e.vip))).then(function l() {
    if (t.onReadyBeingFired.length > 0) {
      let c = t.onReadyBeingFired.reduce(td, je);
      return t.onReadyBeingFired = [], ae.resolve(nu(() => c(e.vip))).then(l);
    }
  }))).finally(() => {
    t.onReadyBeingFired = null, t.isBeingOpened = !1;
  }).then(() => e).catch((l) => {
    t.dbOpenError = l;
    try {
      s && s.abort();
    } catch {
    }
    return r === t.openCanceller && e._close(), ft(l);
  }).finally(() => {
    t.openComplete = !0, i();
  });
}
function ru(e) {
  var t = (i) => e.next(i), n = o(t), r = o((i) => e.throw(i));
  function o(i) {
    return (s) => {
      var a = i(s), l = a.value;
      return a.done ? l : l && typeof l.then == "function" ? l.then(n, r) : _t(l) ? Promise.all(l).then(n, r) : n(l);
    };
  }
  return o(t)();
}
function wI(e, t, n) {
  var r = arguments.length;
  if (r < 2)
    throw new ve.InvalidArgument("Too few arguments");
  for (var o = new Array(r - 1); --r; )
    o[r - 1] = arguments[r];
  return n = o.pop(), [e, Kg(o), n];
}
function mv(e, t, n, r, o) {
  return ae.resolve().then(() => {
    const i = he.transless || he, s = e._createTransaction(t, n, e._dbSchema, r), a = { trans: s, transless: i };
    if (r)
      s.idbtrans = r.idbtrans;
    else
      try {
        s.create(), e._state.PR1398_maxLoop = 3;
      } catch (d) {
        return d.name === ed.InvalidState && e.isOpen() && --e._state.PR1398_maxLoop > 0 ? (console.warn("Dexie: Need to reopen db"), e._close(), e.open().then(() => mv(e, t, n, null, o))) : ft(d);
      }
    const l = Ju(o);
    let c;
    l && Uo();
    const u = ae.follow(() => {
      if (c = o.call(s, s), c)
        if (l) {
          var d = An.bind(null, null);
          c.then(d, d);
        } else
          typeof c.next == "function" && typeof c.throw == "function" && (c = ru(c));
    }, a);
    return (c && typeof c.then == "function" ? ae.resolve(c).then((d) => s.active ? d : ft(new ve.PrematureCommit("Transaction committed too early. See http://bit.ly/2kdckMn"))) : u.then(() => c)).then((d) => (r && s._resolve(), s._completion.then(() => d))).catch((d) => (s._reject(d), ft(d)));
  });
}
function qs(e, t, n) {
  const r = _t(e) ? e.slice() : [e];
  for (let o = 0; o < n; ++o)
    r.push(t);
  return r;
}
const xI = { stack: "dbcore", name: "VirtualIndexMiddleware", level: 1, create: function(e) {
  return { ...e, table(t) {
    const n = e.table(t), { schema: r } = n, o = {}, i = [];
    function s(u, d, f) {
      const m = Ti(u), h = o[m] = o[m] || [], p = u == null ? 0 : typeof u == "string" ? 1 : u.length, g = d > 0, v = { ...f, isVirtual: g, keyTail: d, keyLength: p, extractKey: Zc(u), unique: !g && f.unique };
      return h.push(v), v.isPrimaryKey || i.push(v), p > 1 && s(p === 2 ? u[0] : u.slice(0, p - 1), d + 1, f), h.sort((y, b) => y.keyTail - b.keyTail), v;
    }
    const a = s(r.primaryKey.keyPath, 0, r.primaryKey);
    o[":id"] = [a];
    for (const u of r.indexes)
      s(u.keyPath, 0, u);
    function l(u) {
      const d = u.query.index;
      return d.isVirtual ? { ...u, query: { index: d, range: (f = u.query.range, m = d.keyTail, { type: f.type === 1 ? 2 : f.type, lower: qs(f.lower, f.lowerOpen ? e.MAX_KEY : e.MIN_KEY, m), lowerOpen: !0, upper: qs(f.upper, f.upperOpen ? e.MIN_KEY : e.MAX_KEY, m), upperOpen: !0 }) } } : u;
      var f, m;
    }
    return { ...n, schema: { ...r, primaryKey: a, indexes: i, getIndexByKeyPath: function(u) {
      const d = o[Ti(u)];
      return d && d[0];
    } }, count: (u) => n.count(l(u)), query: (u) => n.query(l(u)), openCursor(u) {
      const { keyTail: d, isVirtual: f, keyLength: m } = u.query.index;
      return f ? n.openCursor(l(u)).then((h) => h && function(p) {
        return Object.create(p, { continue: { value: function(v) {
          v != null ? p.continue(qs(v, u.reverse ? e.MAX_KEY : e.MIN_KEY, d)) : u.unique ? p.continue(p.key.slice(0, m).concat(u.reverse ? e.MIN_KEY : e.MAX_KEY, d)) : p.continue();
        } }, continuePrimaryKey: { value(v, y) {
          p.continuePrimaryKey(qs(v, e.MAX_KEY, d), y);
        } }, primaryKey: { get: () => p.primaryKey }, key: { get() {
          const v = p.key;
          return m === 1 ? v[0] : v.slice(0, m);
        } }, value: { get: () => p.value } });
      }(h)) : n.openCursor(u);
    } };
  } };
} };
function ad(e, t, n, r) {
  return n = n || {}, r = r || "", st(e).forEach((o) => {
    if (Vt(t, o)) {
      var i = e[o], s = t[o];
      if (typeof i == "object" && typeof s == "object" && i && s) {
        const a = Pc(i);
        a !== Pc(s) ? n[r + o] = t[o] : a === "Object" ? ad(i, s, n, r + o + ".") : i !== s && (n[r + o] = t[o]);
      } else
        i !== s && (n[r + o] = t[o]);
    } else
      n[r + o] = void 0;
  }), st(t).forEach((o) => {
    Vt(e, o) || (n[r + o] = t[o]);
  }), n;
}
const SI = { stack: "dbcore", name: "HooksMiddleware", level: 2, create: (e) => ({ ...e, table(t) {
  const n = e.table(t), { primaryKey: r } = n.schema;
  return { ...n, mutate(i) {
    const s = he.trans, { deleting: a, creating: l, updating: c } = s.table(t).hook;
    switch (i.type) {
      case "add":
        if (l.fire === je)
          break;
        return s._promise("readwrite", () => u(i), !0);
      case "put":
        if (l.fire === je && c.fire === je)
          break;
        return s._promise("readwrite", () => u(i), !0);
      case "delete":
        if (a.fire === je)
          break;
        return s._promise("readwrite", () => u(i), !0);
      case "deleteRange":
        if (a.fire === je)
          break;
        return s._promise("readwrite", () => function(f) {
          return d(f.trans, f.range, 1e4);
        }(i), !0);
    }
    return n.mutate(i);
    function u(f) {
      const m = he.trans, h = f.keys || function(p, g) {
        return g.type === "delete" ? g.keys : g.keys || g.values.map(p.extractKey);
      }(r, f);
      if (!h)
        throw new Error("Keys missing");
      return (f = f.type === "add" || f.type === "put" ? { ...f, keys: h } : { ...f }).type !== "delete" && (f.values = [...f.values]), f.keys && (f.keys = [...f.keys]), function(p, g, v) {
        return g.type === "add" ? Promise.resolve([]) : p.getMany({ trans: g.trans, keys: v, cache: "immutable" });
      }(n, f, h).then((p) => {
        const g = h.map((v, y) => {
          const b = p[y], E = { onerror: null, onsuccess: null };
          if (f.type === "delete")
            a.fire.call(E, v, b, m);
          else if (f.type === "add" || b === void 0) {
            const S = l.fire.call(E, v, f.values[y], m);
            v == null && S != null && (v = S, f.keys[y] = v, r.outbound || Qt(f.values[y], r.keyPath, v));
          } else {
            const S = ad(b, f.values[y]), T = c.fire.call(E, S, v, b, m);
            if (T) {
              const C = f.values[y];
              Object.keys(T).forEach((_) => {
                Vt(C, _) ? C[_] = T[_] : Qt(C, _, T[_]);
              });
            }
          }
          return E;
        });
        return n.mutate(f).then(({ failures: v, results: y, numFailures: b, lastResult: E }) => {
          for (let S = 0; S < h.length; ++S) {
            const T = y ? y[S] : h[S], C = g[S];
            T == null ? C.onerror && C.onerror(v[S]) : C.onsuccess && C.onsuccess(f.type === "put" && p[S] ? f.values[S] : T);
          }
          return { failures: v, results: y, numFailures: b, lastResult: E };
        }).catch((v) => (g.forEach((y) => y.onerror && y.onerror(v)), Promise.reject(v)));
      });
    }
    function d(f, m, h) {
      return n.query({ trans: f, values: !1, query: { index: r, range: m }, limit: h }).then(({ result: p }) => u({ type: "delete", keys: p, trans: f }).then((g) => g.numFailures > 0 ? Promise.reject(g.failures[0]) : p.length < h ? { failures: [], numFailures: 0, lastResult: void 0 } : d(f, { ...m, lower: p[p.length - 1], lowerOpen: !0 }, h)));
    }
  } };
} }) };
function gv(e, t, n) {
  try {
    if (!t || t.keys.length < e.length)
      return null;
    const r = [];
    for (let o = 0, i = 0; o < t.keys.length && i < e.length; ++o)
      At(t.keys[o], e[i]) === 0 && (r.push(n ? vs(t.values[o]) : t.values[o]), ++i);
    return r.length === e.length ? r : null;
  } catch {
    return null;
  }
}
const EI = { stack: "dbcore", level: -1, create: (e) => ({ table: (t) => {
  const n = e.table(t);
  return { ...n, getMany: (r) => {
    if (!r.cache)
      return n.getMany(r);
    const o = gv(r.keys, r.trans._cache, r.cache === "clone");
    return o ? ae.resolve(o) : n.getMany(r).then((i) => (r.trans._cache = { keys: r.keys, values: r.cache === "clone" ? vs(i) : i }, i));
  }, mutate: (r) => (r.type !== "add" && (r.trans._cache = null), n.mutate(r)) };
} }) };
function ld(e) {
  return !("from" in e);
}
const wn = function(e, t) {
  if (!this) {
    const n = new wn();
    return e && "d" in e && kt(n, e), n;
  }
  kt(this, arguments.length ? { d: 1, from: e, to: arguments.length > 1 ? t : e } : { d: 0 });
};
function ts(e, t, n) {
  const r = At(t, n);
  if (isNaN(r))
    return;
  if (r > 0)
    throw RangeError();
  if (ld(e))
    return kt(e, { from: t, to: n, d: 1 });
  const o = e.l, i = e.r;
  if (At(n, e.from) < 0)
    return o ? ts(o, t, n) : e.l = { from: t, to: n, d: 1, l: null, r: null }, Ch(e);
  if (At(t, e.to) > 0)
    return i ? ts(i, t, n) : e.r = { from: t, to: n, d: 1, l: null, r: null }, Ch(e);
  At(t, e.from) < 0 && (e.from = t, e.l = null, e.d = i ? i.d + 1 : 1), At(n, e.to) > 0 && (e.to = n, e.r = null, e.d = e.l ? e.l.d + 1 : 1);
  const s = !e.r;
  o && !e.l && Ba(e, o), i && s && Ba(e, i);
}
function Ba(e, t) {
  ld(t) || function n(r, { from: o, to: i, l: s, r: a }) {
    ts(r, o, i), s && n(r, s), a && n(r, a);
  }(e, t);
}
function _I(e, t) {
  const n = ou(t);
  let r = n.next();
  if (r.done)
    return !1;
  let o = r.value;
  const i = ou(e);
  let s = i.next(o.from), a = s.value;
  for (; !r.done && !s.done; ) {
    if (At(a.from, o.to) <= 0 && At(a.to, o.from) >= 0)
      return !0;
    At(o.from, a.from) < 0 ? o = (r = n.next(a.from)).value : a = (s = i.next(o.from)).value;
  }
  return !1;
}
function ou(e) {
  let t = ld(e) ? null : { s: 0, n: e };
  return { next(n) {
    const r = arguments.length > 0;
    for (; t; )
      switch (t.s) {
        case 0:
          if (t.s = 1, r)
            for (; t.n.l && At(n, t.n.from) < 0; )
              t = { up: t, n: t.n.l, s: 1 };
          else
            for (; t.n.l; )
              t = { up: t, n: t.n.l, s: 1 };
        case 1:
          if (t.s = 2, !r || At(n, t.n.to) <= 0)
            return { value: t.n, done: !1 };
        case 2:
          if (t.n.r) {
            t.s = 3, t = { up: t, n: t.n.r, s: 0 };
            continue;
          }
        case 3:
          t = t.up;
      }
    return { done: !0 };
  } };
}
function Ch(e) {
  var t, n;
  const r = (((t = e.r) === null || t === void 0 ? void 0 : t.d) || 0) - (((n = e.l) === null || n === void 0 ? void 0 : n.d) || 0), o = r > 1 ? "r" : r < -1 ? "l" : "";
  if (o) {
    const i = o === "r" ? "l" : "r", s = { ...e }, a = e[o];
    e.from = a.from, e.to = a.to, e[o] = a[o], s[o] = a[i], e[i] = s, s.d = wh(s);
  }
  e.d = wh(e);
}
function wh({ r: e, l: t }) {
  return (e ? t ? Math.max(e.d, t.d) : e.d : t ? t.d : 0) + 1;
}
$o(wn.prototype, { add(e) {
  return Ba(this, e), this;
}, addKey(e) {
  return ts(this, e, e), this;
}, addKeys(e) {
  return e.forEach((t) => ts(this, t, t)), this;
}, [Fc]() {
  return ou(this);
} });
const II = { stack: "dbcore", level: 0, create: (e) => {
  const t = e.schema.name, n = new wn(e.MIN_KEY, e.MAX_KEY);
  return { ...e, table: (r) => {
    const o = e.table(r), { schema: i } = o, { primaryKey: s } = i, { extractKey: a, outbound: l } = s, c = { ...o, mutate: (f) => {
      const m = f.trans, h = m.mutatedParts || (m.mutatedParts = {}), p = (T) => {
        const C = `idb://${t}/${r}/${T}`;
        return h[C] || (h[C] = new wn());
      }, g = p(""), v = p(":dels"), { type: y } = f;
      let [b, E] = f.type === "deleteRange" ? [f.range] : f.type === "delete" ? [f.keys] : f.values.length < 50 ? [[], f.values] : [];
      const S = f.trans._cache;
      return o.mutate(f).then((T) => {
        if (_t(b)) {
          y !== "delete" && (b = T.results), g.addKeys(b);
          const C = gv(b, S);
          C || y === "add" || v.addKeys(b), (C || E) && function(_, w, R, O) {
            function I(L) {
              const D = _(L.name || "");
              function P(N) {
                return N != null ? L.extractKey(N) : null;
              }
              const k = (N) => L.multiEntry && _t(N) ? N.forEach(($) => D.addKey($)) : D.addKey(N);
              (R || O).forEach((N, $) => {
                const B = R && P(R[$]), U = O && P(O[$]);
                At(B, U) !== 0 && (B != null && k(B), U != null && k(U));
              });
            }
            w.indexes.forEach(I);
          }(p, i, C, E);
        } else if (b) {
          const C = { from: b.lower, to: b.upper };
          v.add(C), g.add(C);
        } else
          g.add(n), v.add(n), i.indexes.forEach((C) => p(C.name).add(n));
        return T;
      });
    } }, u = ({ query: { index: f, range: m } }) => {
      var h, p;
      return [f, new wn((h = m.lower) !== null && h !== void 0 ? h : e.MIN_KEY, (p = m.upper) !== null && p !== void 0 ? p : e.MAX_KEY)];
    }, d = { get: (f) => [s, new wn(f.key)], getMany: (f) => [s, new wn().addKeys(f.keys)], count: u, query: u, openCursor: u };
    return st(d).forEach((f) => {
      c[f] = function(m) {
        const { subscr: h } = he;
        if (h) {
          const p = (E) => {
            const S = `idb://${t}/${r}/${E}`;
            return h[S] || (h[S] = new wn());
          }, g = p(""), v = p(":dels"), [y, b] = d[f](m);
          if (p(y.name || "").add(b), !y.isPrimaryKey) {
            if (f !== "count") {
              const E = f === "query" && l && m.values && o.query({ ...m, values: !1 });
              return o[f].apply(this, arguments).then((S) => {
                if (f === "query") {
                  if (l && m.values)
                    return E.then(({ result: C }) => (g.addKeys(C), S));
                  const T = m.values ? S.result.map(a) : S.result;
                  m.values ? g.addKeys(T) : v.addKeys(T);
                } else if (f === "openCursor") {
                  const T = S, C = m.values;
                  return T && Object.create(T, { key: { get: () => (v.addKey(T.primaryKey), T.key) }, primaryKey: { get() {
                    const _ = T.primaryKey;
                    return v.addKey(_), _;
                  } }, value: { get: () => (C && g.addKey(T.primaryKey), T.value) } });
                }
                return S;
              });
            }
            v.add(n);
          }
        }
        return o[f].apply(this, arguments);
      };
    }), c;
  } };
} };
class Pr {
  constructor(t, n) {
    this._middlewares = {}, this.verno = 0;
    const r = Pr.dependencies;
    this._options = n = { addons: Pr.addons, autoOpen: !0, indexedDB: r.indexedDB, IDBKeyRange: r.IDBKeyRange, ...n }, this._deps = { indexedDB: n.indexedDB, IDBKeyRange: n.IDBKeyRange };
    const { addons: o } = n;
    this._dbSchema = {}, this._versions = [], this._storeNames = [], this._allTables = {}, this.idbdb = null, this._novip = this;
    const i = { dbOpenError: null, isBeingOpened: !1, onReadyBeingFired: null, openComplete: !1, dbReadyResolve: je, dbReadyPromise: null, cancelOpen: je, openCanceller: null, autoSchema: !0, PR1398_maxLoop: 3 };
    var s;
    i.dbReadyPromise = new ae((a) => {
      i.dbReadyResolve = a;
    }), i.openCanceller = new ae((a, l) => {
      i.cancelOpen = l;
    }), this._state = i, this.name = t, this.on = Ni(this, "populate", "blocked", "versionchange", "close", { ready: [td, je] }), this.on.ready.subscribe = jg(this.on.ready.subscribe, (a) => (l, c) => {
      Pr.vip(() => {
        const u = this._state;
        if (u.openComplete)
          u.dbOpenError || ae.resolve().then(l), c && a(l);
        else if (u.onReadyBeingFired)
          u.onReadyBeingFired.push(l), c && a(l);
        else {
          a(l);
          const d = this;
          c || a(function f() {
            d.on.ready.unsubscribe(l), d.on.ready.unsubscribe(f);
          });
        }
      });
    }), this.Collection = (s = this, oi(cI.prototype, function(a, l) {
      this.db = s;
      let c = cv, u = null;
      if (l)
        try {
          c = l();
        } catch (h) {
          u = h;
        }
      const d = a._ctx, f = d.table, m = f.hook.reading.fire;
      this._ctx = { table: f, index: d.index, isPrimKey: !d.index || f.schema.primKey.keyPath && d.index === f.schema.primKey.name, range: c, keysOnly: !1, dir: "next", unique: "", algorithm: null, filter: null, replayFilter: null, justLimit: !0, isMatch: null, offset: 0, limit: 1 / 0, error: u, or: d.or, valueMapper: m !== Zi ? m : null };
    })), this.Table = function(a) {
      return oi(lI.prototype, function(l, c, u) {
        this.db = a, this._tx = u, this.name = l, this.schema = c, this.hook = a._allTables[l] ? a._allTables[l].hook : Ni(null, { creating: [Z_, je], reading: [q_, Zi], updating: [J_, je], deleting: [X_, je] });
      });
    }(this), this.Transaction = function(a) {
      return oi(hI.prototype, function(l, c, u, d, f) {
        this.db = a, this.mode = l, this.storeNames = c, this.schema = u, this.chromeTransactionDurability = d, this.idbtrans = null, this.on = Ni(this, "complete", "error", "abort"), this.parent = f || null, this.active = !0, this._reculock = 0, this._blockedFuncs = [], this._resolve = null, this._reject = null, this._waitingFor = null, this._waitingQueue = null, this._spinCount = 0, this._completion = new ae((m, h) => {
          this._resolve = m, this._reject = h;
        }), this._completion.then(() => {
          this.active = !1, this.on.complete.fire();
        }, (m) => {
          var h = this.active;
          return this.active = !1, this.on.error.fire(m), this.parent ? this.parent._reject(m) : h && this.idbtrans && this.idbtrans.abort(), ft(m);
        });
      });
    }(this), this.Version = function(a) {
      return oi(yI.prototype, function(l) {
        this.db = a, this._cfg = { version: l, storesSource: null, dbschema: {}, tables: {}, contentUpgrade: null };
      });
    }(this), this.WhereClause = function(a) {
      return oi(dv.prototype, function(l, c, u) {
        this.db = a, this._ctx = { table: l, index: c === ":id" ? null : c, or: u };
        const d = a._deps.indexedDB;
        if (!d)
          throw new ve.MissingAPI();
        this._cmp = this._ascending = d.cmp.bind(d), this._descending = (f, m) => d.cmp(m, f), this._max = (f, m) => d.cmp(f, m) > 0 ? f : m, this._min = (f, m) => d.cmp(f, m) < 0 ? f : m, this._IDBKeyRange = a._deps.IDBKeyRange;
      });
    }(this), this.on("versionchange", (a) => {
      a.newVersion > 0 ? console.warn(`Another connection wants to upgrade database '${this.name}'. Closing db now to resume the upgrade.`) : console.warn(`Another connection wants to delete database '${this.name}'. Closing db now to resume the delete request.`), this.close();
    }), this.on("blocked", (a) => {
      !a.newVersion || a.newVersion < a.oldVersion ? console.warn(`Dexie.delete('${this.name}') was blocked`) : console.warn(`Upgrade '${this.name}' blocked by other connection holding version ${a.oldVersion / 10}`);
    }), this._maxKey = es(n.IDBKeyRange), this._createTransaction = (a, l, c, u) => new this.Transaction(a, l, c, this._options.chromeTransactionDurability, u), this._fireOnBlocked = (a) => {
      this.on("blocked").fire(a), Ii.filter((l) => l.name === this.name && l !== this && !l._state.vcFired).map((l) => l.on("versionchange").fire(a));
    }, this.use(xI), this.use(SI), this.use(II), this.use(EI), this.vip = Object.create(this, { _vip: { value: !0 } }), o.forEach((a) => a(this));
  }
  version(t) {
    if (isNaN(t) || t < 0.1)
      throw new ve.Type("Given version is not a positive number");
    if (t = Math.round(10 * t) / 10, this.idbdb || this._state.isBeingOpened)
      throw new ve.Schema("Cannot add version when database is open");
    this.verno = Math.max(this.verno, t);
    const n = this._versions;
    var r = n.filter((o) => o._cfg.version === t)[0];
    return r || (r = new this.Version(t), n.push(r), n.sort(gI), r.stores({}), this._state.autoSchema = !1, r);
  }
  _whenReady(t) {
    return this.idbdb && (this._state.openComplete || he.letThrough || this._vip) ? t() : new ae((n, r) => {
      if (this._state.openComplete)
        return r(new ve.DatabaseClosed(this._state.dbOpenError));
      if (!this._state.isBeingOpened) {
        if (!this._options.autoOpen)
          return void r(new ve.DatabaseClosed());
        this.open().catch(je);
      }
      this._state.dbReadyPromise.then(n, r);
    }).then(t);
  }
  use({ stack: t, create: n, level: r, name: o }) {
    o && this.unuse({ stack: t, name: o });
    const i = this._middlewares[t] || (this._middlewares[t] = []);
    return i.push({ stack: t, create: n, level: r ?? 10, name: o }), i.sort((s, a) => s.level - a.level), this;
  }
  unuse({ stack: t, name: n, create: r }) {
    return t && this._middlewares[t] && (this._middlewares[t] = this._middlewares[t].filter((o) => r ? o.create !== r : !!n && o.name !== n)), this;
  }
  open() {
    return CI(this);
  }
  _close() {
    const t = this._state, n = Ii.indexOf(this);
    if (n >= 0 && Ii.splice(n, 1), this.idbdb) {
      try {
        this.idbdb.close();
      } catch {
      }
      this._novip.idbdb = null;
    }
    t.dbReadyPromise = new ae((r) => {
      t.dbReadyResolve = r;
    }), t.openCanceller = new ae((r, o) => {
      t.cancelOpen = o;
    });
  }
  close() {
    this._close();
    const t = this._state;
    this._options.autoOpen = !1, t.dbOpenError = new ve.DatabaseClosed(), t.isBeingOpened && t.cancelOpen(t.dbOpenError);
  }
  delete() {
    const t = arguments.length > 0, n = this._state;
    return new ae((r, o) => {
      const i = () => {
        this.close();
        var s = this._deps.indexedDB.deleteDatabase(this.name);
        s.onsuccess = Je(() => {
          (function({ indexedDB: a, IDBKeyRange: l }, c) {
            !sd(a) && c !== Cl && id(a, l).delete(c).catch(je);
          })(this._deps, this.name), r();
        }), s.onerror = ln(o), s.onblocked = this._fireOnBlocked;
      };
      if (t)
        throw new ve.InvalidArgument("Arguments not allowed in db.delete()");
      n.isBeingOpened ? n.dbReadyPromise.then(i) : i();
    });
  }
  backendDB() {
    return this.idbdb;
  }
  isOpen() {
    return this.idbdb !== null;
  }
  hasBeenClosed() {
    const t = this._state.dbOpenError;
    return t && t.name === "DatabaseClosed";
  }
  hasFailed() {
    return this._state.dbOpenError !== null;
  }
  dynamicallyOpened() {
    return this._state.autoSchema;
  }
  get tables() {
    return st(this._allTables).map((t) => this._allTables[t]);
  }
  transaction() {
    const t = wI.apply(this, arguments);
    return this._transaction.apply(this, t);
  }
  _transaction(t, n, r) {
    let o = he.trans;
    o && o.db === this && t.indexOf("!") === -1 || (o = null);
    const i = t.indexOf("?") !== -1;
    let s, a;
    t = t.replace("!", "").replace("?", "");
    try {
      if (a = n.map((c) => {
        var u = c instanceof this.Table ? c.name : c;
        if (typeof u != "string")
          throw new TypeError("Invalid table argument to Dexie.transaction(). Only Table or String are allowed");
        return u;
      }), t == "r" || t === Vl)
        s = Vl;
      else {
        if (t != "rw" && t != zl)
          throw new ve.InvalidArgument("Invalid transaction mode: " + t);
        s = zl;
      }
      if (o) {
        if (o.mode === Vl && s === zl) {
          if (!i)
            throw new ve.SubTransaction("Cannot enter a sub-transaction with READWRITE mode when parent transaction is READONLY");
          o = null;
        }
        o && a.forEach((c) => {
          if (o && o.storeNames.indexOf(c) === -1) {
            if (!i)
              throw new ve.SubTransaction("Table " + c + " not included in parent transaction.");
            o = null;
          }
        }), i && o && !o.active && (o = null);
      }
    } catch (c) {
      return o ? o._promise(null, (u, d) => {
        d(c);
      }) : ft(c);
    }
    const l = mv.bind(null, this, s, a, o, r);
    return o ? o._promise(s, l, "lock") : he.trans ? Ko(he.transless, () => this._whenReady(l)) : this._whenReady(l);
  }
  table(t) {
    if (!Vt(this._allTables, t))
      throw new ve.InvalidTable(`Table ${t} does not exist`);
    return this._allTables[t];
  }
}
const NI = typeof Symbol < "u" && "observable" in Symbol ? Symbol.observable : "@@observable";
class TI {
  constructor(t) {
    this._subscribe = t;
  }
  subscribe(t, n, r) {
    return this._subscribe(t && typeof t != "function" ? t : { next: t, error: n, complete: r });
  }
  [NI]() {
    return this;
  }
}
function vv(e, t) {
  return st(t).forEach((n) => {
    Ba(e[n] || (e[n] = new wn()), t[n]);
  }), e;
}
function OI(e) {
  let t, n = !1;
  const r = new TI((o) => {
    const i = Ju(e);
    let s = !1, a = {}, l = {};
    const c = { get closed() {
      return s;
    }, unsubscribe: () => {
      s = !0, sr.storagemutated.unsubscribe(m);
    } };
    o.start && o.start(c);
    let u = !1, d = !1;
    function f() {
      return st(l).some((p) => a[p] && _I(a[p], l[p]));
    }
    const m = (p) => {
      vv(a, p), f() && h();
    }, h = () => {
      if (u || s)
        return;
      a = {};
      const p = {}, g = function(v) {
        i && Uo();
        const y = () => or(e, { subscr: v, trans: null }), b = he.trans ? Ko(he.transless, y) : y();
        return i && b.then(An, An), b;
      }(p);
      d || (sr(Qi, m), d = !0), u = !0, Promise.resolve(g).then((v) => {
        n = !0, t = v, u = !1, s || (f() ? h() : (a = {}, l = p, o.next && o.next(v)));
      }, (v) => {
        u = !1, n = !1, o.error && o.error(v), c.unsubscribe();
      });
    };
    return h(), c;
  });
  return r.hasValue = () => n, r.getValue = () => t, r;
}
let iu;
try {
  iu = { indexedDB: Ge.indexedDB || Ge.mozIndexedDB || Ge.webkitIndexedDB || Ge.msIndexedDB, IDBKeyRange: Ge.IDBKeyRange || Ge.webkitIDBKeyRange };
} catch {
  iu = { indexedDB: null, IDBKeyRange: null };
}
const hr = Pr;
function ha(e) {
  let t = Sn;
  try {
    Sn = !0, sr.storagemutated.fire(e);
  } finally {
    Sn = t;
  }
}
$o(hr, { ...aa, delete: (e) => new hr(e, { addons: [] }).delete(), exists: (e) => new hr(e, { addons: [] }).open().then((t) => (t.close(), !0)).catch("NoSuchDatabaseError", () => !1), getDatabaseNames(e) {
  try {
    return function({ indexedDB: t, IDBKeyRange: n }) {
      return sd(t) ? Promise.resolve(t.databases()).then((r) => r.map((o) => o.name).filter((o) => o !== Cl)) : id(t, n).toCollection().primaryKeys();
    }(hr.dependencies).then(e);
  } catch {
    return ft(new ve.MissingAPI());
  }
}, defineClass: () => function(e) {
  kt(this, e);
}, ignoreTransaction: (e) => he.trans ? Ko(he.transless, e) : e(), vip: nu, async: function(e) {
  return function() {
    try {
      var t = ru(e.apply(this, arguments));
      return t && typeof t.then == "function" ? t : ae.resolve(t);
    } catch (n) {
      return ft(n);
    }
  };
}, spawn: function(e, t, n) {
  try {
    var r = ru(e.apply(n, t || []));
    return r && typeof r.then == "function" ? r : ae.resolve(r);
  } catch (o) {
    return ft(o);
  }
}, currentTransaction: { get: () => he.trans || null }, waitFor: function(e, t) {
  const n = ae.resolve(typeof e == "function" ? hr.ignoreTransaction(e) : e).timeout(t || 6e4);
  return he.trans ? he.trans.waitFor(n) : n;
}, Promise: ae, debug: { get: () => fn, set: (e) => {
  Yg(e, e === "dexie" ? () => !0 : lv);
} }, derive: _o, extend: kt, props: $o, override: jg, Events: Ni, on: sr, liveQuery: OI, extendObservabilitySet: vv, getByKeyPath: Nn, setByKeyPath: Qt, delByKeyPath: function(e, t) {
  typeof t == "string" ? Qt(e, t, void 0) : "length" in t && [].map.call(t, function(n) {
    Qt(e, n, void 0);
  });
}, shallowClone: Ug, deepClone: vs, getObjectDiff: ad, cmp: At, asap: Hg, minKey: Yc, addons: [], connections: Ii, errnames: ed, dependencies: iu, semVer: ph, version: ph.split(".").map((e) => parseInt(e)).reduce((e, t, n) => e + t / Math.pow(10, 2 * n)) }), hr.maxKey = es(hr.dependencies.IDBKeyRange), typeof dispatchEvent < "u" && typeof addEventListener < "u" && (sr(Qi, (e) => {
  if (!Sn) {
    let t;
    bl ? (t = document.createEvent("CustomEvent"), t.initCustomEvent(Kn, !0, !0, e)) : t = new CustomEvent(Kn, { detail: e }), Sn = !0, dispatchEvent(t), Sn = !1;
  }
}), addEventListener(Kn, ({ detail: e }) => {
  Sn || ha(e);
}));
let Sn = !1;
if (typeof BroadcastChannel < "u") {
  const e = new BroadcastChannel(Kn);
  typeof e.unref == "function" && e.unref(), sr(Qi, (t) => {
    Sn || e.postMessage(t);
  }), e.onmessage = (t) => {
    t.data && ha(t.data);
  };
} else if (typeof self < "u" && typeof navigator < "u") {
  sr(Qi, (t) => {
    try {
      Sn || (typeof localStorage < "u" && localStorage.setItem(Kn, JSON.stringify({ trig: Math.random(), changedParts: t })), typeof self.clients == "object" && [...self.clients.matchAll({ includeUncontrolled: !0 })].forEach((n) => n.postMessage({ type: Kn, changedParts: t })));
    } catch {
    }
  }), typeof addEventListener < "u" && addEventListener("storage", (t) => {
    if (t.key === Kn) {
      const n = JSON.parse(t.newValue);
      n && ha(n.changedParts);
    }
  });
  const e = self.document && navigator.serviceWorker;
  e && e.addEventListener("message", function({ data: t }) {
    t && t.type === Kn && ha(t.changedParts);
  });
}
ae.rejectionMapper = function(e, t) {
  if (!e || e instanceof Io || e instanceof TypeError || e instanceof SyntaxError || !e.name || !uh[e.name])
    return e;
  var n = new uh[e.name](t || e.message, e);
  return "stack" in e && In(n, "stack", { get: function() {
    return this.inner.stack;
  } }), n;
}, Yg(fn, lv);
var ht;
(function(e) {
  e[e.Document = 0] = "Document", e[e.DocumentType = 1] = "DocumentType", e[e.Element = 2] = "Element", e[e.Text = 3] = "Text", e[e.CDATA = 4] = "CDATA", e[e.Comment = 5] = "Comment";
})(ht || (ht = {}));
function AI(e) {
  return e.nodeType === e.ELEMENT_NODE;
}
function Oi(e) {
  var t = e == null ? void 0 : e.host;
  return (t == null ? void 0 : t.shadowRoot) === e;
}
function Ai(e) {
  return Object.prototype.toString.call(e) === "[object ShadowRoot]";
}
function DI(e) {
  return e.includes(" background-clip: text;") && !e.includes(" -webkit-background-clip: text;") && (e = e.replace(" background-clip: text;", " -webkit-background-clip: text; background-clip: text;")), e;
}
function su(e) {
  try {
    var t = e.rules || e.cssRules;
    return t ? DI(Array.from(t).map(yv).join("")) : null;
  } catch {
    return null;
  }
}
function yv(e) {
  var t = e.cssText;
  if (MI(e))
    try {
      t = su(e.styleSheet) || t;
    } catch {
    }
  return t;
}
function MI(e) {
  return "styleSheet" in e;
}
var bv = function() {
  function e() {
    this.idNodeMap = /* @__PURE__ */ new Map(), this.nodeMetaMap = /* @__PURE__ */ new WeakMap();
  }
  return e.prototype.getId = function(t) {
    var n;
    if (!t)
      return -1;
    var r = (n = this.getMeta(t)) === null || n === void 0 ? void 0 : n.id;
    return r ?? -1;
  }, e.prototype.getNode = function(t) {
    return this.idNodeMap.get(t) || null;
  }, e.prototype.getIds = function() {
    return Array.from(this.idNodeMap.keys());
  }, e.prototype.getMeta = function(t) {
    return this.nodeMetaMap.get(t) || null;
  }, e.prototype.removeNodeFromMap = function(t) {
    var n = this, r = this.getId(t);
    this.idNodeMap.delete(r), t.childNodes && t.childNodes.forEach(function(o) {
      return n.removeNodeFromMap(o);
    });
  }, e.prototype.has = function(t) {
    return this.idNodeMap.has(t);
  }, e.prototype.hasNode = function(t) {
    return this.nodeMetaMap.has(t);
  }, e.prototype.add = function(t, n) {
    var r = n.id;
    this.idNodeMap.set(r, t), this.nodeMetaMap.set(t, n);
  }, e.prototype.replace = function(t, n) {
    var r = this.getNode(t);
    if (r) {
      var o = this.nodeMetaMap.get(r);
      o && this.nodeMetaMap.set(n, o);
    }
    this.idNodeMap.set(t, n);
  }, e.prototype.reset = function() {
    this.idNodeMap = /* @__PURE__ */ new Map(), this.nodeMetaMap = /* @__PURE__ */ new WeakMap();
  }, e;
}();
function $I() {
  return new bv();
}
function cd(e) {
  var t = e.maskInputOptions, n = e.tagName, r = e.type, o = e.value, i = e.maskInputFn, s = o || "";
  return (t[n.toLowerCase()] || t[r]) && (i ? s = i(s) : s = "*".repeat(s.length)), s;
}
var xh = "__rrweb_original__";
function kI(e) {
  var t = e.getContext("2d");
  if (!t)
    return !0;
  for (var n = 50, r = 0; r < e.width; r += n)
    for (var o = 0; o < e.height; o += n) {
      var i = t.getImageData, s = xh in i ? i[xh] : i, a = new Uint32Array(s.call(t, r, o, Math.min(n, e.width - r), Math.min(n, e.height - o)).data.buffer);
      if (a.some(function(l) {
        return l !== 0;
      }))
        return !1;
    }
  return !0;
}
var RI = 1, PI = new RegExp("[^a-z0-9-_:]"), ns = -2;
function Cv() {
  return RI++;
}
function FI(e) {
  if (e instanceof HTMLFormElement)
    return "form";
  var t = e.tagName.toLowerCase().trim();
  return PI.test(t) ? "div" : t;
}
function BI(e) {
  return e.cssRules ? Array.from(e.cssRules).map(function(t) {
    return t.cssText || "";
  }).join("") : "";
}
function LI(e) {
  var t = "";
  return e.indexOf("//") > -1 ? t = e.split("/").slice(0, 3).join("/") : t = e.split("/")[0], t = t.split("?")[0], t;
}
var oo, Sh, VI = /url\((?:(')([^']*)'|(")(.*?)"|([^)]*))\)/gm, zI = /^(?!www\.|(?:http|ftp)s?:\/\/|[A-Za-z]:\\|\/\/|#).*/, jI = /^(data:)([^,]*),(.*)/i;
function La(e, t) {
  return (e || "").replace(VI, function(n, r, o, i, s, a) {
    var l = o || s || a, c = r || i || "";
    if (!l)
      return n;
    if (!zI.test(l) || jI.test(l))
      return "url(".concat(c).concat(l).concat(c, ")");
    if (l[0] === "/")
      return "url(".concat(c).concat(LI(t) + l).concat(c, ")");
    var u = t.split("/"), d = l.split("/");
    u.pop();
    for (var f = 0, m = d; f < m.length; f++) {
      var h = m[f];
      h !== "." && (h === ".." ? u.pop() : u.push(h));
    }
    return "url(".concat(c).concat(u.join("/")).concat(c, ")");
  });
}
var HI = /^[^ \t\n\r\u000c]+/, WI = /^[, \t\n\r\u000c]+/;
function UI(e, t) {
  if (t.trim() === "")
    return t;
  var n = 0;
  function r(c) {
    var u, d = c.exec(t.substring(n));
    return d ? (u = d[0], n += u.length, u) : "";
  }
  for (var o = []; r(WI), !(n >= t.length); ) {
    var i = r(HI);
    if (i.slice(-1) === ",")
      i = mo(e, i.substring(0, i.length - 1)), o.push(i);
    else {
      var s = "";
      i = mo(e, i);
      for (var a = !1; ; ) {
        var l = t.charAt(n);
        if (l === "") {
          o.push((i + s).trim());
          break;
        } else if (a)
          l === ")" && (a = !1);
        else if (l === ",") {
          n += 1, o.push((i + s).trim());
          break;
        } else
          l === "(" && (a = !0);
        s += l, n += 1;
      }
    }
  }
  return o.join(", ");
}
function mo(e, t) {
  if (!t || t.trim() === "")
    return t;
  var n = e.createElement("a");
  return n.href = t, n.href;
}
function KI(e) {
  return !!(e.tagName === "svg" || e.ownerSVGElement);
}
function ud() {
  var e = document.createElement("a");
  return e.href = "", e.href;
}
function wv(e, t, n, r) {
  return n === "src" || n === "href" && r && !(t === "use" && r[0] === "#") || n === "xlink:href" && r && r[0] !== "#" || n === "background" && r && (t === "table" || t === "td" || t === "th") ? mo(e, r) : n === "srcset" && r ? UI(e, r) : n === "style" && r ? La(r, ud()) : t === "object" && n === "data" && r ? mo(e, r) : r;
}
function GI(e, t, n) {
  if (typeof t == "string") {
    if (e.classList.contains(t))
      return !0;
  } else
    for (var r = e.classList.length; r--; ) {
      var o = e.classList[r];
      if (t.test(o))
        return !0;
    }
  return n ? e.matches(n) : !1;
}
function Va(e, t, n) {
  if (!e)
    return !1;
  if (e.nodeType !== e.ELEMENT_NODE)
    return n ? Va(e.parentNode, t, n) : !1;
  for (var r = e.classList.length; r--; ) {
    var o = e.classList[r];
    if (t.test(o))
      return !0;
  }
  return n ? Va(e.parentNode, t, n) : !1;
}
function xv(e, t, n) {
  var r = e.nodeType === e.ELEMENT_NODE ? e : e.parentElement;
  if (r === null)
    return !1;
  if (typeof t == "string") {
    if (r.classList.contains(t) || r.closest(".".concat(t)))
      return !0;
  } else if (Va(r, t, !0))
    return !0;
  return !!(n && (r.matches(n) || r.closest(n)));
}
function YI(e, t, n) {
  var r = e.contentWindow;
  if (r) {
    var o = !1, i;
    try {
      i = r.document.readyState;
    } catch {
      return;
    }
    if (i !== "complete") {
      var s = setTimeout(function() {
        o || (t(), o = !0);
      }, n);
      e.addEventListener("load", function() {
        clearTimeout(s), o = !0, t();
      });
      return;
    }
    var a = "about:blank";
    if (r.location.href !== a || e.src === a || e.src === "")
      return setTimeout(t, 0), e.addEventListener("load", t);
    e.addEventListener("load", t);
  }
}
function qI(e, t, n) {
  var r = !1, o;
  try {
    o = e.sheet;
  } catch {
    return;
  }
  if (!o) {
    var i = setTimeout(function() {
      r || (t(), r = !0);
    }, n);
    e.addEventListener("load", function() {
      clearTimeout(i), r = !0, t();
    });
  }
}
function ZI(e, t) {
  var n = t.doc, r = t.mirror, o = t.blockClass, i = t.blockSelector, s = t.maskTextClass, a = t.maskTextSelector, l = t.inlineStylesheet, c = t.maskInputOptions, u = c === void 0 ? {} : c, d = t.maskTextFn, f = t.maskInputFn, m = t.dataURLOptions, h = m === void 0 ? {} : m, p = t.inlineImages, g = t.recordCanvas, v = t.keepIframeSrcFn, y = t.newlyAddedElement, b = y === void 0 ? !1 : y, E = XI(n, r);
  switch (e.nodeType) {
    case e.DOCUMENT_NODE:
      return e.compatMode !== "CSS1Compat" ? {
        type: ht.Document,
        childNodes: [],
        compatMode: e.compatMode
      } : {
        type: ht.Document,
        childNodes: []
      };
    case e.DOCUMENT_TYPE_NODE:
      return {
        type: ht.DocumentType,
        name: e.name,
        publicId: e.publicId,
        systemId: e.systemId,
        rootId: E
      };
    case e.ELEMENT_NODE:
      return QI(e, {
        doc: n,
        blockClass: o,
        blockSelector: i,
        inlineStylesheet: l,
        maskInputOptions: u,
        maskInputFn: f,
        dataURLOptions: h,
        inlineImages: p,
        recordCanvas: g,
        keepIframeSrcFn: v,
        newlyAddedElement: b,
        rootId: E
      });
    case e.TEXT_NODE:
      return JI(e, {
        maskTextClass: s,
        maskTextSelector: a,
        maskTextFn: d,
        rootId: E
      });
    case e.CDATA_SECTION_NODE:
      return {
        type: ht.CDATA,
        textContent: "",
        rootId: E
      };
    case e.COMMENT_NODE:
      return {
        type: ht.Comment,
        textContent: e.textContent || "",
        rootId: E
      };
    default:
      return !1;
  }
}
function XI(e, t) {
  if (t.hasNode(e)) {
    var n = t.getId(e);
    return n === 1 ? void 0 : n;
  }
}
function JI(e, t) {
  var n, r = t.maskTextClass, o = t.maskTextSelector, i = t.maskTextFn, s = t.rootId, a = e.parentNode && e.parentNode.tagName, l = e.textContent, c = a === "STYLE" ? !0 : void 0, u = a === "SCRIPT" ? !0 : void 0;
  if (c && l) {
    try {
      e.nextSibling || e.previousSibling || !((n = e.parentNode.sheet) === null || n === void 0) && n.cssRules && (l = BI(e.parentNode.sheet));
    } catch (d) {
      console.warn("Cannot get CSS styles from text's parentNode. Error: ".concat(d), e);
    }
    l = La(l, ud());
  }
  return u && (l = "SCRIPT_PLACEHOLDER"), !c && !u && l && xv(e, r, o) && (l = i ? i(l) : l.replace(/[\S]/g, "*")), {
    type: ht.Text,
    textContent: l || "",
    isStyle: c,
    rootId: s
  };
}
function QI(e, t) {
  for (var n = t.doc, r = t.blockClass, o = t.blockSelector, i = t.inlineStylesheet, s = t.maskInputOptions, a = s === void 0 ? {} : s, l = t.maskInputFn, c = t.dataURLOptions, u = c === void 0 ? {} : c, d = t.inlineImages, f = t.recordCanvas, m = t.keepIframeSrcFn, h = t.newlyAddedElement, p = h === void 0 ? !1 : h, g = t.rootId, v = GI(e, r, o), y = FI(e), b = {}, E = e.attributes.length, S = 0; S < E; S++) {
    var T = e.attributes[S];
    b[T.name] = wv(n, y, T.name, T.value);
  }
  if (y === "link" && i) {
    var C = Array.from(n.styleSheets).find(function(U) {
      return U.href === e.href;
    }), _ = null;
    C && (_ = su(C)), _ && (delete b.rel, delete b.href, b._cssText = La(_, C.href));
  }
  if (y === "style" && e.sheet && !(e.innerText || e.textContent || "").trim().length) {
    var _ = su(e.sheet);
    _ && (b._cssText = La(_, ud()));
  }
  if (y === "input" || y === "textarea" || y === "select") {
    var w = e.value, R = e.checked;
    b.type !== "radio" && b.type !== "checkbox" && b.type !== "submit" && b.type !== "button" && w ? b.value = cd({
      type: b.type,
      tagName: y,
      value: w,
      maskInputOptions: a,
      maskInputFn: l
    }) : R && (b.checked = R);
  }
  if (y === "option" && (e.selected && !a.select ? b.selected = !0 : delete b.selected), y === "canvas" && f) {
    if (e.__context === "2d")
      kI(e) || (b.rr_dataURL = e.toDataURL(u.type, u.quality));
    else if (!("__context" in e)) {
      var O = e.toDataURL(u.type, u.quality), I = document.createElement("canvas");
      I.width = e.width, I.height = e.height;
      var L = I.toDataURL(u.type, u.quality);
      O !== L && (b.rr_dataURL = O);
    }
  }
  if (y === "img" && d) {
    oo || (oo = n.createElement("canvas"), Sh = oo.getContext("2d"));
    var D = e, P = D.crossOrigin;
    D.crossOrigin = "anonymous";
    var k = function() {
      try {
        oo.width = D.naturalWidth, oo.height = D.naturalHeight, Sh.drawImage(D, 0, 0), b.rr_dataURL = oo.toDataURL(u.type, u.quality);
      } catch (U) {
        console.warn("Cannot inline img src=".concat(D.currentSrc, "! Error: ").concat(U));
      }
      P ? b.crossOrigin = P : D.removeAttribute("crossorigin");
    };
    D.complete && D.naturalWidth !== 0 ? k() : D.onload = k;
  }
  if ((y === "audio" || y === "video") && (b.rr_mediaState = e.paused ? "paused" : "played", b.rr_mediaCurrentTime = e.currentTime), p || (e.scrollLeft && (b.rr_scrollLeft = e.scrollLeft), e.scrollTop && (b.rr_scrollTop = e.scrollTop)), v) {
    var N = e.getBoundingClientRect(), $ = N.width, B = N.height;
    b = {
      class: b.class,
      rr_width: "".concat($, "px"),
      rr_height: "".concat(B, "px")
    };
  }
  return y === "iframe" && !m(b.src) && (e.contentDocument || (b.rr_src = b.src), delete b.src), {
    type: ht.Element,
    tagName: y,
    attributes: b,
    childNodes: [],
    isSVG: KI(e) || void 0,
    needBlock: v,
    rootId: g
  };
}
function He(e) {
  return e === void 0 ? "" : e.toLowerCase();
}
function eN(e, t) {
  if (t.comment && e.type === ht.Comment)
    return !0;
  if (e.type === ht.Element) {
    if (t.script && (e.tagName === "script" || e.tagName === "link" && e.attributes.rel === "preload" && e.attributes.as === "script" || e.tagName === "link" && e.attributes.rel === "prefetch" && typeof e.attributes.href == "string" && e.attributes.href.endsWith(".js")))
      return !0;
    if (t.headFavicon && (e.tagName === "link" && e.attributes.rel === "shortcut icon" || e.tagName === "meta" && (He(e.attributes.name).match(/^msapplication-tile(image|color)$/) || He(e.attributes.name) === "application-name" || He(e.attributes.rel) === "icon" || He(e.attributes.rel) === "apple-touch-icon" || He(e.attributes.rel) === "shortcut icon")))
      return !0;
    if (e.tagName === "meta") {
      if (t.headMetaDescKeywords && He(e.attributes.name).match(/^description|keywords$/))
        return !0;
      if (t.headMetaSocial && (He(e.attributes.property).match(/^(og|twitter|fb):/) || He(e.attributes.name).match(/^(og|twitter):/) || He(e.attributes.name) === "pinterest"))
        return !0;
      if (t.headMetaRobots && (He(e.attributes.name) === "robots" || He(e.attributes.name) === "googlebot" || He(e.attributes.name) === "bingbot"))
        return !0;
      if (t.headMetaHttpEquiv && e.attributes["http-equiv"] !== void 0)
        return !0;
      if (t.headMetaAuthorship && (He(e.attributes.name) === "author" || He(e.attributes.name) === "generator" || He(e.attributes.name) === "framework" || He(e.attributes.name) === "publisher" || He(e.attributes.name) === "progid" || He(e.attributes.property).match(/^article:/) || He(e.attributes.property).match(/^product:/)))
        return !0;
      if (t.headMetaVerification && (He(e.attributes.name) === "google-site-verification" || He(e.attributes.name) === "yandex-verification" || He(e.attributes.name) === "csrf-token" || He(e.attributes.name) === "p:domain_verify" || He(e.attributes.name) === "verify-v1" || He(e.attributes.name) === "verification" || He(e.attributes.name) === "shopify-checkout-api-token"))
        return !0;
    }
  }
  return !1;
}
function go(e, t) {
  var n = t.doc, r = t.mirror, o = t.blockClass, i = t.blockSelector, s = t.maskTextClass, a = t.maskTextSelector, l = t.skipChild, c = l === void 0 ? !1 : l, u = t.inlineStylesheet, d = u === void 0 ? !0 : u, f = t.maskInputOptions, m = f === void 0 ? {} : f, h = t.maskTextFn, p = t.maskInputFn, g = t.slimDOMOptions, v = t.dataURLOptions, y = v === void 0 ? {} : v, b = t.inlineImages, E = b === void 0 ? !1 : b, S = t.recordCanvas, T = S === void 0 ? !1 : S, C = t.onSerialize, _ = t.onIframeLoad, w = t.iframeLoadTimeout, R = w === void 0 ? 5e3 : w, O = t.onStylesheetLoad, I = t.stylesheetLoadTimeout, L = I === void 0 ? 5e3 : I, D = t.keepIframeSrcFn, P = D === void 0 ? function() {
    return !1;
  } : D, k = t.newlyAddedElement, N = k === void 0 ? !1 : k, $ = t.preserveWhiteSpace, B = $ === void 0 ? !0 : $, U = ZI(e, {
    doc: n,
    mirror: r,
    blockClass: o,
    blockSelector: i,
    maskTextClass: s,
    maskTextSelector: a,
    inlineStylesheet: d,
    maskInputOptions: m,
    maskTextFn: h,
    maskInputFn: p,
    dataURLOptions: y,
    inlineImages: E,
    recordCanvas: T,
    keepIframeSrcFn: P,
    newlyAddedElement: N
  });
  if (!U)
    return console.warn(e, "not serialized"), null;
  var J;
  r.hasNode(e) ? J = r.getId(e) : eN(U, g) || !B && U.type === ht.Text && !U.isStyle && !U.textContent.replace(/^\s+|\s+$/gm, "").length ? J = ns : J = Cv();
  var te = Object.assign(U, { id: J });
  if (r.add(e, te), J === ns)
    return null;
  C && C(e);
  var ie = !c;
  if (te.type === ht.Element) {
    ie = ie && !te.needBlock, delete te.needBlock;
    var z = e.shadowRoot;
    z && Ai(z) && (te.isShadowHost = !0);
  }
  if ((te.type === ht.Document || te.type === ht.Element) && ie) {
    g.headWhitespace && te.type === ht.Element && te.tagName === "head" && (B = !1);
    for (var le = {
      doc: n,
      mirror: r,
      blockClass: o,
      blockSelector: i,
      maskTextClass: s,
      maskTextSelector: a,
      skipChild: c,
      inlineStylesheet: d,
      maskInputOptions: m,
      maskTextFn: h,
      maskInputFn: p,
      slimDOMOptions: g,
      dataURLOptions: y,
      inlineImages: E,
      recordCanvas: T,
      preserveWhiteSpace: B,
      onSerialize: C,
      onIframeLoad: _,
      iframeLoadTimeout: R,
      onStylesheetLoad: O,
      stylesheetLoadTimeout: L,
      keepIframeSrcFn: P
    }, j = 0, pe = Array.from(e.childNodes); j < pe.length; j++) {
      var ne = pe[j], ee = go(ne, le);
      ee && te.childNodes.push(ee);
    }
    if (AI(e) && e.shadowRoot)
      for (var we = 0, me = Array.from(e.shadowRoot.childNodes); we < me.length; we++) {
        var ne = me[we], ee = go(ne, le);
        ee && (Ai(e.shadowRoot) && (ee.isShadow = !0), te.childNodes.push(ee));
      }
  }
  return e.parentNode && Oi(e.parentNode) && Ai(e.parentNode) && (te.isShadow = !0), te.type === ht.Element && te.tagName === "iframe" && YI(e, function() {
    var De = e.contentDocument;
    if (De && _) {
      var x = go(De, {
        doc: De,
        mirror: r,
        blockClass: o,
        blockSelector: i,
        maskTextClass: s,
        maskTextSelector: a,
        skipChild: !1,
        inlineStylesheet: d,
        maskInputOptions: m,
        maskTextFn: h,
        maskInputFn: p,
        slimDOMOptions: g,
        dataURLOptions: y,
        inlineImages: E,
        recordCanvas: T,
        preserveWhiteSpace: B,
        onSerialize: C,
        onIframeLoad: _,
        iframeLoadTimeout: R,
        onStylesheetLoad: O,
        stylesheetLoadTimeout: L,
        keepIframeSrcFn: P
      });
      x && _(e, x);
    }
  }, R), te.type === ht.Element && te.tagName === "link" && te.attributes.rel === "stylesheet" && qI(e, function() {
    if (O) {
      var De = go(e, {
        doc: n,
        mirror: r,
        blockClass: o,
        blockSelector: i,
        maskTextClass: s,
        maskTextSelector: a,
        skipChild: !1,
        inlineStylesheet: d,
        maskInputOptions: m,
        maskTextFn: h,
        maskInputFn: p,
        slimDOMOptions: g,
        dataURLOptions: y,
        inlineImages: E,
        recordCanvas: T,
        preserveWhiteSpace: B,
        onSerialize: C,
        onIframeLoad: _,
        iframeLoadTimeout: R,
        onStylesheetLoad: O,
        stylesheetLoadTimeout: L,
        keepIframeSrcFn: P
      });
      De && O(e, De);
    }
  }, L), te;
}
function tN(e, t) {
  var n = t || {}, r = n.mirror, o = r === void 0 ? new bv() : r, i = n.blockClass, s = i === void 0 ? "rr-block" : i, a = n.blockSelector, l = a === void 0 ? null : a, c = n.maskTextClass, u = c === void 0 ? "rr-mask" : c, d = n.maskTextSelector, f = d === void 0 ? null : d, m = n.inlineStylesheet, h = m === void 0 ? !0 : m, p = n.inlineImages, g = p === void 0 ? !1 : p, v = n.recordCanvas, y = v === void 0 ? !1 : v, b = n.maskAllInputs, E = b === void 0 ? !1 : b, S = n.maskTextFn, T = n.maskInputFn, C = n.slimDOM, _ = C === void 0 ? !1 : C, w = n.dataURLOptions, R = n.preserveWhiteSpace, O = n.onSerialize, I = n.onIframeLoad, L = n.iframeLoadTimeout, D = n.onStylesheetLoad, P = n.stylesheetLoadTimeout, k = n.keepIframeSrcFn, N = k === void 0 ? function() {
    return !1;
  } : k, $ = E === !0 ? {
    color: !0,
    date: !0,
    "datetime-local": !0,
    email: !0,
    month: !0,
    number: !0,
    range: !0,
    search: !0,
    tel: !0,
    text: !0,
    time: !0,
    url: !0,
    week: !0,
    textarea: !0,
    select: !0,
    password: !0
  } : E === !1 ? {
    password: !0
  } : E, B = _ === !0 || _ === "all" ? {
    script: !0,
    comment: !0,
    headFavicon: !0,
    headWhitespace: !0,
    headMetaDescKeywords: _ === "all",
    headMetaSocial: !0,
    headMetaRobots: !0,
    headMetaHttpEquiv: !0,
    headMetaAuthorship: !0,
    headMetaVerification: !0
  } : _ === !1 ? {} : _;
  return go(e, {
    doc: e,
    mirror: o,
    blockClass: s,
    blockSelector: l,
    maskTextClass: u,
    maskTextSelector: f,
    skipChild: !1,
    inlineStylesheet: h,
    maskInputOptions: $,
    maskTextFn: S,
    maskInputFn: T,
    slimDOMOptions: B,
    dataURLOptions: w,
    inlineImages: g,
    recordCanvas: y,
    preserveWhiteSpace: R,
    onSerialize: O,
    onIframeLoad: I,
    iframeLoadTimeout: L,
    onStylesheetLoad: D,
    stylesheetLoadTimeout: P,
    keepIframeSrcFn: N,
    newlyAddedElement: !1
  });
}
function Dt(e, t, n = document) {
  const r = { capture: !0, passive: !0 };
  return n.addEventListener(e, t, r), () => n.removeEventListener(e, t, r);
}
const lo = `Please stop import mirror directly. Instead of that,\r
now you can use replayer.getMirror() to access the mirror instance of a replayer,\r
or you can use record.mirror to access the mirror instance during recording.`;
let Eh = {
  map: {},
  getId() {
    return console.error(lo), -1;
  },
  getNode() {
    return console.error(lo), null;
  },
  removeNodeFromMap() {
    console.error(lo);
  },
  has() {
    return console.error(lo), !1;
  },
  reset() {
    console.error(lo);
  }
};
typeof window < "u" && window.Proxy && window.Reflect && (Eh = new Proxy(Eh, {
  get(e, t, n) {
    return t === "map" && console.error(lo), Reflect.get(e, t, n);
  }
}));
function rs(e, t, n = {}) {
  let r = null, o = 0;
  return function(...i) {
    const s = Date.now();
    !o && n.leading === !1 && (o = s);
    const a = t - (s - o), l = this;
    a <= 0 || a > t ? (r && (clearTimeout(r), r = null), o = s, e.apply(l, i)) : !r && n.trailing !== !1 && (r = setTimeout(() => {
      o = n.leading === !1 ? 0 : Date.now(), r = null, e.apply(l, i);
    }, a));
  };
}
function wl(e, t, n, r, o = window) {
  const i = o.Object.getOwnPropertyDescriptor(e, t);
  return o.Object.defineProperty(e, t, r ? n : {
    set(s) {
      setTimeout(() => {
        n.set.call(this, s);
      }, 0), i && i.set && i.set.call(this, s);
    }
  }), () => wl(e, t, i || {}, !0);
}
function ko(e, t, n) {
  try {
    if (!(t in e))
      return () => {
      };
    const r = e[t], o = n(r);
    return typeof o == "function" && (o.prototype = o.prototype || {}, Object.defineProperties(o, {
      __rrweb_original__: {
        enumerable: !1,
        value: r
      }
    })), e[t] = o, () => {
      e[t] = r;
    };
  } catch {
    return () => {
    };
  }
}
function Sv() {
  return window.innerHeight || document.documentElement && document.documentElement.clientHeight || document.body && document.body.clientHeight;
}
function Ev() {
  return window.innerWidth || document.documentElement && document.documentElement.clientWidth || document.body && document.body.clientWidth;
}
function Mt(e, t, n, r) {
  if (!e)
    return !1;
  const o = e.nodeType === e.ELEMENT_NODE ? e : e.parentElement;
  if (!o)
    return !1;
  if (typeof t == "string") {
    if (o.classList.contains(t) || r && o.closest("." + t) !== null)
      return !0;
  } else if (Va(o, t, r))
    return !0;
  return !!(n && (e.matches(n) || r && o.closest(n) !== null));
}
function nN(e, t) {
  return t.getId(e) !== -1;
}
function Kl(e, t) {
  return t.getId(e) === ns;
}
function _v(e, t) {
  if (Oi(e))
    return !1;
  const n = t.getId(e);
  return t.has(n) ? e.parentNode && e.parentNode.nodeType === e.DOCUMENT_NODE ? !1 : e.parentNode ? _v(e.parentNode, t) : !0 : !0;
}
function Iv(e) {
  return !!e.changedTouches;
}
function rN(e = window) {
  "NodeList" in e && !e.NodeList.prototype.forEach && (e.NodeList.prototype.forEach = Array.prototype.forEach), "DOMTokenList" in e && !e.DOMTokenList.prototype.forEach && (e.DOMTokenList.prototype.forEach = Array.prototype.forEach), Node.prototype.contains || (Node.prototype.contains = (...t) => {
    let n = t[0];
    if (!(0 in t))
      throw new TypeError("1 argument is required");
    do
      if (this === n)
        return !0;
    while (n = n && n.parentNode);
    return !1;
  });
}
function Nv(e, t) {
  return !!(e.nodeName === "IFRAME" && t.getMeta(e));
}
function Tv(e, t) {
  return !!(e.nodeName === "LINK" && e.nodeType === e.ELEMENT_NODE && e.getAttribute && e.getAttribute("rel") === "stylesheet" && t.getMeta(e));
}
function Ov(e) {
  return !!(e != null && e.shadowRoot);
}
class oN {
  constructor() {
    this.id = 1, this.styleIDMap = /* @__PURE__ */ new WeakMap(), this.idStyleMap = /* @__PURE__ */ new Map();
  }
  getId(t) {
    var n;
    return (n = this.styleIDMap.get(t)) !== null && n !== void 0 ? n : -1;
  }
  has(t) {
    return this.styleIDMap.has(t);
  }
  add(t, n) {
    if (this.has(t))
      return this.getId(t);
    let r;
    return n === void 0 ? r = this.id++ : r = n, this.styleIDMap.set(t, r), this.idStyleMap.set(r, t), r;
  }
  getStyle(t) {
    return this.idStyleMap.get(t) || null;
  }
  reset() {
    this.styleIDMap = /* @__PURE__ */ new WeakMap(), this.idStyleMap = /* @__PURE__ */ new Map(), this.id = 1;
  }
  generateId() {
    return this.id++;
  }
}
var ke = /* @__PURE__ */ ((e) => (e[e.DomContentLoaded = 0] = "DomContentLoaded", e[e.Load = 1] = "Load", e[e.FullSnapshot = 2] = "FullSnapshot", e[e.IncrementalSnapshot = 3] = "IncrementalSnapshot", e[e.Meta = 4] = "Meta", e[e.Custom = 5] = "Custom", e[e.Plugin = 6] = "Plugin", e))(ke || {}), Ae = /* @__PURE__ */ ((e) => (e[e.Mutation = 0] = "Mutation", e[e.MouseMove = 1] = "MouseMove", e[e.MouseInteraction = 2] = "MouseInteraction", e[e.Scroll = 3] = "Scroll", e[e.ViewportResize = 4] = "ViewportResize", e[e.Input = 5] = "Input", e[e.TouchMove = 6] = "TouchMove", e[e.MediaInteraction = 7] = "MediaInteraction", e[e.StyleSheetRule = 8] = "StyleSheetRule", e[e.CanvasMutation = 9] = "CanvasMutation", e[e.Font = 10] = "Font", e[e.Log = 11] = "Log", e[e.Drag = 12] = "Drag", e[e.StyleDeclaration = 13] = "StyleDeclaration", e[e.Selection = 14] = "Selection", e[e.AdoptedStyleSheet = 15] = "AdoptedStyleSheet", e))(Ae || {}), au = /* @__PURE__ */ ((e) => (e[e.MouseUp = 0] = "MouseUp", e[e.MouseDown = 1] = "MouseDown", e[e.Click = 2] = "Click", e[e.ContextMenu = 3] = "ContextMenu", e[e.DblClick = 4] = "DblClick", e[e.Focus = 5] = "Focus", e[e.Blur = 6] = "Blur", e[e.TouchStart = 7] = "TouchStart", e[e.TouchMove_Departed = 8] = "TouchMove_Departed", e[e.TouchEnd = 9] = "TouchEnd", e[e.TouchCancel = 10] = "TouchCancel", e))(au || {}), Ro = /* @__PURE__ */ ((e) => (e[e["2D"] = 0] = "2D", e[e.WebGL = 1] = "WebGL", e[e.WebGL2 = 2] = "WebGL2", e))(Ro || {});
function _h(e) {
  return "__ln" in e;
}
class iN {
  constructor() {
    this.length = 0, this.head = null;
  }
  get(t) {
    if (t >= this.length)
      throw new Error("Position outside of list range");
    let n = this.head;
    for (let r = 0; r < t; r++)
      n = (n == null ? void 0 : n.next) || null;
    return n;
  }
  addNode(t) {
    const n = {
      value: t,
      previous: null,
      next: null
    };
    if (t.__ln = n, t.previousSibling && _h(t.previousSibling)) {
      const r = t.previousSibling.__ln.next;
      n.next = r, n.previous = t.previousSibling.__ln, t.previousSibling.__ln.next = n, r && (r.previous = n);
    } else if (t.nextSibling && _h(t.nextSibling) && t.nextSibling.__ln.previous) {
      const r = t.nextSibling.__ln.previous;
      n.previous = r, n.next = t.nextSibling.__ln, t.nextSibling.__ln.previous = n, r && (r.next = n);
    } else
      this.head && (this.head.previous = n), n.next = this.head, this.head = n;
    this.length++;
  }
  removeNode(t) {
    const n = t.__ln;
    this.head && (n.previous ? (n.previous.next = n.next, n.next && (n.next.previous = n.previous)) : (this.head = n.next, this.head && (this.head.previous = null)), t.__ln && delete t.__ln, this.length--);
  }
}
const Ih = (e, t) => `${e}@${t}`;
class sN {
  constructor() {
    this.frozen = !1, this.locked = !1, this.texts = [], this.attributes = [], this.removes = [], this.mapRemoves = [], this.movedMap = {}, this.addedSet = /* @__PURE__ */ new Set(), this.movedSet = /* @__PURE__ */ new Set(), this.droppedSet = /* @__PURE__ */ new Set(), this.processMutations = (t) => {
      t.forEach(this.processMutation), this.emit();
    }, this.emit = () => {
      if (this.frozen || this.locked)
        return;
      const t = [], n = new iN(), r = (a) => {
        let l = a, c = ns;
        for (; c === ns; )
          l = l && l.nextSibling, c = l && this.mirror.getId(l);
        return c;
      }, o = (a) => {
        var l, c, u, d;
        let f = null;
        ((c = (l = a.getRootNode) === null || l === void 0 ? void 0 : l.call(a)) === null || c === void 0 ? void 0 : c.nodeType) === Node.DOCUMENT_FRAGMENT_NODE && a.getRootNode().host && (f = a.getRootNode().host);
        let m = f;
        for (; ((d = (u = m == null ? void 0 : m.getRootNode) === null || u === void 0 ? void 0 : u.call(m)) === null || d === void 0 ? void 0 : d.nodeType) === Node.DOCUMENT_FRAGMENT_NODE && m.getRootNode().host; )
          m = m.getRootNode().host;
        const h = !this.doc.contains(a) && (!m || !this.doc.contains(m));
        if (!a.parentNode || h)
          return;
        const p = Oi(a.parentNode) ? this.mirror.getId(f) : this.mirror.getId(a.parentNode), g = r(a);
        if (p === -1 || g === -1)
          return n.addNode(a);
        const v = go(a, {
          doc: this.doc,
          mirror: this.mirror,
          blockClass: this.blockClass,
          blockSelector: this.blockSelector,
          maskTextClass: this.maskTextClass,
          maskTextSelector: this.maskTextSelector,
          skipChild: !0,
          newlyAddedElement: !0,
          inlineStylesheet: this.inlineStylesheet,
          maskInputOptions: this.maskInputOptions,
          maskTextFn: this.maskTextFn,
          maskInputFn: this.maskInputFn,
          slimDOMOptions: this.slimDOMOptions,
          dataURLOptions: this.dataURLOptions,
          recordCanvas: this.recordCanvas,
          inlineImages: this.inlineImages,
          onSerialize: (y) => {
            Nv(y, this.mirror) && this.iframeManager.addIframe(y), Tv(y, this.mirror) && this.stylesheetManager.trackLinkElement(y), Ov(a) && this.shadowDomManager.addShadowRoot(a.shadowRoot, this.doc);
          },
          onIframeLoad: (y, b) => {
            this.iframeManager.attachIframe(y, b), this.shadowDomManager.observeAttachShadow(y);
          },
          onStylesheetLoad: (y, b) => {
            this.stylesheetManager.attachLinkElement(y, b);
          }
        });
        v && t.push({
          parentId: p,
          nextId: g,
          node: v
        });
      };
      for (; this.mapRemoves.length; )
        this.mirror.removeNodeFromMap(this.mapRemoves.shift());
      for (const a of Array.from(this.movedSet.values()))
        Nh(this.removes, a, this.mirror) && !this.movedSet.has(a.parentNode) || o(a);
      for (const a of Array.from(this.addedSet.values()))
        !Th(this.droppedSet, a) && !Nh(this.removes, a, this.mirror) || Th(this.movedSet, a) ? o(a) : this.droppedSet.add(a);
      let i = null;
      for (; n.length; ) {
        let a = null;
        if (i) {
          const l = this.mirror.getId(i.value.parentNode), c = r(i.value);
          l !== -1 && c !== -1 && (a = i);
        }
        if (!a)
          for (let l = n.length - 1; l >= 0; l--) {
            const c = n.get(l);
            if (c) {
              const u = this.mirror.getId(c.value.parentNode);
              if (r(c.value) === -1)
                continue;
              if (u !== -1) {
                a = c;
                break;
              } else {
                const f = c.value;
                if (f.parentNode && f.parentNode.nodeType === Node.DOCUMENT_FRAGMENT_NODE) {
                  const m = f.parentNode.host;
                  if (this.mirror.getId(m) !== -1) {
                    a = c;
                    break;
                  }
                }
              }
            }
          }
        if (!a) {
          for (; n.head; )
            n.removeNode(n.head.value);
          break;
        }
        i = a.previous, n.removeNode(a.value), o(a.value);
      }
      const s = {
        texts: this.texts.map((a) => ({
          id: this.mirror.getId(a.node),
          value: a.value
        })).filter((a) => this.mirror.has(a.id)),
        attributes: this.attributes.map((a) => ({
          id: this.mirror.getId(a.node),
          attributes: a.attributes
        })).filter((a) => this.mirror.has(a.id)),
        removes: this.removes,
        adds: t
      };
      !s.texts.length && !s.attributes.length && !s.removes.length && !s.adds.length || (this.texts = [], this.attributes = [], this.removes = [], this.addedSet = /* @__PURE__ */ new Set(), this.movedSet = /* @__PURE__ */ new Set(), this.droppedSet = /* @__PURE__ */ new Set(), this.movedMap = {}, this.mutationCb(s));
    }, this.processMutation = (t) => {
      if (!Kl(t.target, this.mirror))
        switch (t.type) {
          case "characterData": {
            const n = t.target.textContent;
            !Mt(t.target, this.blockClass, this.blockSelector, !1) && n !== t.oldValue && this.texts.push({
              value: xv(t.target, this.maskTextClass, this.maskTextSelector) && n ? this.maskTextFn ? this.maskTextFn(n) : n.replace(/[\S]/g, "*") : n,
              node: t.target
            });
            break;
          }
          case "attributes": {
            const n = t.target;
            let r = t.target.getAttribute(t.attributeName);
            if (t.attributeName === "value" && (r = cd({
              maskInputOptions: this.maskInputOptions,
              tagName: t.target.tagName,
              type: t.target.getAttribute("type"),
              value: r,
              maskInputFn: this.maskInputFn
            })), Mt(t.target, this.blockClass, this.blockSelector, !1) || r === t.oldValue)
              return;
            let o = this.attributes.find((i) => i.node === t.target);
            if (n.tagName === "IFRAME" && t.attributeName === "src" && !this.keepIframeSrcFn(r))
              if (!n.contentDocument)
                t.attributeName = "rr_src";
              else
                return;
            if (o || (o = {
              node: t.target,
              attributes: {}
            }, this.attributes.push(o)), t.attributeName === "style") {
              const i = this.doc.createElement("span");
              t.oldValue && i.setAttribute("style", t.oldValue), (o.attributes.style === void 0 || o.attributes.style === null) && (o.attributes.style = {});
              const s = o.attributes.style;
              for (const a of Array.from(n.style)) {
                const l = n.style.getPropertyValue(a), c = n.style.getPropertyPriority(a);
                (l !== i.style.getPropertyValue(a) || c !== i.style.getPropertyPriority(a)) && (c === "" ? s[a] = l : s[a] = [l, c]);
              }
              for (const a of Array.from(i.style))
                n.style.getPropertyValue(a) === "" && (s[a] = !1);
            } else
              o.attributes[t.attributeName] = wv(this.doc, n.tagName, t.attributeName, r);
            break;
          }
          case "childList": {
            if (Mt(t.target, this.blockClass, this.blockSelector, !0))
              return;
            t.addedNodes.forEach((n) => this.genAdds(n, t.target)), t.removedNodes.forEach((n) => {
              const r = this.mirror.getId(n), o = Oi(t.target) ? this.mirror.getId(t.target.host) : this.mirror.getId(t.target);
              Mt(t.target, this.blockClass, this.blockSelector, !1) || Kl(n, this.mirror) || !nN(n, this.mirror) || (this.addedSet.has(n) ? (lu(this.addedSet, n), this.droppedSet.add(n)) : this.addedSet.has(t.target) && r === -1 || _v(t.target, this.mirror) || (this.movedSet.has(n) && this.movedMap[Ih(r, o)] ? lu(this.movedSet, n) : this.removes.push({
                parentId: o,
                id: r,
                isShadow: Oi(t.target) && Ai(t.target) ? !0 : void 0
              })), this.mapRemoves.push(n));
            });
            break;
          }
        }
    }, this.genAdds = (t, n) => {
      if (this.mirror.hasNode(t)) {
        if (Kl(t, this.mirror))
          return;
        this.movedSet.add(t);
        let r = null;
        n && this.mirror.hasNode(n) && (r = this.mirror.getId(n)), r && r !== -1 && (this.movedMap[Ih(this.mirror.getId(t), r)] = !0);
      } else
        this.addedSet.add(t), this.droppedSet.delete(t);
      Mt(t, this.blockClass, this.blockSelector, !1) || t.childNodes.forEach((r) => this.genAdds(r));
    };
  }
  init(t) {
    [
      "mutationCb",
      "blockClass",
      "blockSelector",
      "maskTextClass",
      "maskTextSelector",
      "inlineStylesheet",
      "maskInputOptions",
      "maskTextFn",
      "maskInputFn",
      "keepIframeSrcFn",
      "recordCanvas",
      "inlineImages",
      "slimDOMOptions",
      "dataURLOptions",
      "doc",
      "mirror",
      "iframeManager",
      "stylesheetManager",
      "shadowDomManager",
      "canvasManager"
    ].forEach((n) => {
      this[n] = t[n];
    });
  }
  freeze() {
    this.frozen = !0, this.canvasManager.freeze();
  }
  unfreeze() {
    this.frozen = !1, this.canvasManager.unfreeze(), this.emit();
  }
  isFrozen() {
    return this.frozen;
  }
  lock() {
    this.locked = !0, this.canvasManager.lock();
  }
  unlock() {
    this.locked = !1, this.canvasManager.unlock(), this.emit();
  }
  reset() {
    this.shadowDomManager.reset(), this.canvasManager.reset();
  }
}
function lu(e, t) {
  e.delete(t), t.childNodes.forEach((n) => lu(e, n));
}
function Nh(e, t, n) {
  return e.length === 0 ? !1 : Av(e, t, n);
}
function Av(e, t, n) {
  const { parentNode: r } = t;
  if (!r)
    return !1;
  const o = n.getId(r);
  return e.some((i) => i.id === o) ? !0 : Av(e, r, n);
}
function Th(e, t) {
  return e.size === 0 ? !1 : Dv(e, t);
}
function Dv(e, t) {
  const { parentNode: n } = t;
  return n ? e.has(n) ? !0 : Dv(e, n) : !1;
}
const _r = [], Mv = typeof CSSGroupingRule < "u", $v = typeof CSSMediaRule < "u", kv = typeof CSSSupportsRule < "u", Rv = typeof CSSConditionRule < "u";
function Cs(e) {
  try {
    if ("composedPath" in e) {
      const t = e.composedPath();
      if (t.length)
        return t[0];
    } else if ("path" in e && e.path.length)
      return e.path[0];
    return e.target;
  } catch {
    return e.target;
  }
}
function Pv(e, t) {
  var n, r;
  const o = new sN();
  _r.push(o), o.init(e);
  let i = window.MutationObserver || window.__rrMutationObserver;
  const s = (r = (n = window == null ? void 0 : window.Zone) === null || n === void 0 ? void 0 : n.__symbol__) === null || r === void 0 ? void 0 : r.call(n, "MutationObserver");
  s && window[s] && (i = window[s]);
  const a = new i(o.processMutations.bind(o));
  return a.observe(t, {
    attributes: !0,
    attributeOldValue: !0,
    characterData: !0,
    characterDataOldValue: !0,
    childList: !0,
    subtree: !0
  }), a;
}
function aN({ mousemoveCb: e, sampling: t, doc: n, mirror: r }) {
  if (t.mousemove === !1)
    return () => {
    };
  const o = typeof t.mousemove == "number" ? t.mousemove : 50, i = typeof t.mousemoveCallback == "number" ? t.mousemoveCallback : 500;
  let s = [], a;
  const l = rs((d) => {
    const f = Date.now() - a;
    e(s.map((m) => (m.timeOffset -= f, m)), d), s = [], a = null;
  }, i), c = rs((d) => {
    const f = Cs(d), { clientX: m, clientY: h } = Iv(d) ? d.changedTouches[0] : d;
    a || (a = Date.now()), s.push({
      x: m,
      y: h,
      id: r.getId(f),
      timeOffset: Date.now() - a
    }), l(typeof DragEvent < "u" && d instanceof DragEvent ? Ae.Drag : d instanceof MouseEvent ? Ae.MouseMove : Ae.TouchMove);
  }, o, {
    trailing: !1
  }), u = [
    Dt("mousemove", c, n),
    Dt("touchmove", c, n),
    Dt("drag", c, n)
  ];
  return () => {
    u.forEach((d) => d());
  };
}
function lN({ mouseInteractionCb: e, doc: t, mirror: n, blockClass: r, blockSelector: o, sampling: i }) {
  if (i.mouseInteraction === !1)
    return () => {
    };
  const s = i.mouseInteraction === !0 || i.mouseInteraction === void 0 ? {} : i.mouseInteraction, a = [], l = (c) => (u) => {
    const d = Cs(u);
    if (Mt(d, r, o, !0))
      return;
    const f = Iv(u) ? u.changedTouches[0] : u;
    if (!f)
      return;
    const m = n.getId(d), { clientX: h, clientY: p } = f;
    e({
      type: au[c],
      id: m,
      x: h,
      y: p
    });
  };
  return Object.keys(au).filter((c) => Number.isNaN(Number(c)) && !c.endsWith("_Departed") && s[c] !== !1).forEach((c) => {
    const u = c.toLowerCase(), d = l(c);
    a.push(Dt(u, d, t));
  }), () => {
    a.forEach((c) => c());
  };
}
function Fv({ scrollCb: e, doc: t, mirror: n, blockClass: r, blockSelector: o, sampling: i }) {
  const s = rs((a) => {
    const l = Cs(a);
    if (!l || Mt(l, r, o, !0))
      return;
    const c = n.getId(l);
    if (l === t) {
      const u = t.scrollingElement || t.documentElement;
      e({
        id: c,
        x: u.scrollLeft,
        y: u.scrollTop
      });
    } else
      e({
        id: c,
        x: l.scrollLeft,
        y: l.scrollTop
      });
  }, i.scroll || 100);
  return Dt("scroll", s, t);
}
function cN({ viewportResizeCb: e }) {
  let t = -1, n = -1;
  const r = rs(() => {
    const o = Sv(), i = Ev();
    (t !== o || n !== i) && (e({
      width: Number(i),
      height: Number(o)
    }), t = o, n = i);
  }, 200);
  return Dt("resize", r, window);
}
function Oh(e, t) {
  const n = Object.assign({}, e);
  return t || delete n.userTriggered, n;
}
const uN = ["INPUT", "TEXTAREA", "SELECT"], Ah = /* @__PURE__ */ new WeakMap();
function dN({ inputCb: e, doc: t, mirror: n, blockClass: r, blockSelector: o, ignoreClass: i, maskInputOptions: s, maskInputFn: a, sampling: l, userTriggeredOnInput: c }) {
  function u(v) {
    let y = Cs(v);
    const b = v.isTrusted;
    if (y && y.tagName === "OPTION" && (y = y.parentElement), !y || !y.tagName || uN.indexOf(y.tagName) < 0 || Mt(y, r, o, !0))
      return;
    const E = y.type;
    if (y.classList.contains(i))
      return;
    let S = y.value, T = !1;
    E === "radio" || E === "checkbox" ? T = y.checked : (s[y.tagName.toLowerCase()] || s[E]) && (S = cd({
      maskInputOptions: s,
      tagName: y.tagName,
      type: E,
      value: S,
      maskInputFn: a
    })), d(y, Oh({ text: S, isChecked: T, userTriggered: b }, c));
    const C = y.name;
    E === "radio" && C && T && t.querySelectorAll(`input[type="radio"][name="${C}"]`).forEach((_) => {
      _ !== y && d(_, Oh({
        text: _.value,
        isChecked: !T,
        userTriggered: !1
      }, c));
    });
  }
  function d(v, y) {
    const b = Ah.get(v);
    if (!b || b.text !== y.text || b.isChecked !== y.isChecked) {
      Ah.set(v, y);
      const E = n.getId(v);
      e(Object.assign(Object.assign({}, y), { id: E }));
    }
  }
  const m = (l.input === "last" ? ["change"] : ["input", "change"]).map((v) => Dt(v, u, t)), h = t.defaultView;
  if (!h)
    return () => {
      m.forEach((v) => v());
    };
  const p = h.Object.getOwnPropertyDescriptor(h.HTMLInputElement.prototype, "value"), g = [
    [h.HTMLInputElement.prototype, "value"],
    [h.HTMLInputElement.prototype, "checked"],
    [h.HTMLSelectElement.prototype, "value"],
    [h.HTMLTextAreaElement.prototype, "value"],
    [h.HTMLSelectElement.prototype, "selectedIndex"],
    [h.HTMLOptionElement.prototype, "selected"]
  ];
  return p && p.set && m.push(...g.map((v) => wl(v[0], v[1], {
    set() {
      u({ target: this });
    }
  }, !1, h))), () => {
    m.forEach((v) => v());
  };
}
function za(e) {
  const t = [];
  function n(r, o) {
    if (Mv && r.parentRule instanceof CSSGroupingRule || $v && r.parentRule instanceof CSSMediaRule || kv && r.parentRule instanceof CSSSupportsRule || Rv && r.parentRule instanceof CSSConditionRule) {
      const s = Array.from(r.parentRule.cssRules).indexOf(r);
      o.unshift(s);
    } else if (r.parentStyleSheet) {
      const s = Array.from(r.parentStyleSheet.cssRules).indexOf(r);
      o.unshift(s);
    }
    return o;
  }
  return n(e, t);
}
function Wn(e, t, n) {
  let r, o;
  return e ? (e.ownerNode ? r = t.getId(e.ownerNode) : o = n.getId(e), {
    styleId: o,
    id: r
  }) : {};
}
function fN({ styleSheetRuleCb: e, mirror: t, stylesheetManager: n }, { win: r }) {
  const o = r.CSSStyleSheet.prototype.insertRule;
  r.CSSStyleSheet.prototype.insertRule = function(u, d) {
    const { id: f, styleId: m } = Wn(this, t, n.styleMirror);
    return (f && f !== -1 || m && m !== -1) && e({
      id: f,
      styleId: m,
      adds: [{ rule: u, index: d }]
    }), o.apply(this, [u, d]);
  };
  const i = r.CSSStyleSheet.prototype.deleteRule;
  r.CSSStyleSheet.prototype.deleteRule = function(u) {
    const { id: d, styleId: f } = Wn(this, t, n.styleMirror);
    return (d && d !== -1 || f && f !== -1) && e({
      id: d,
      styleId: f,
      removes: [{ index: u }]
    }), i.apply(this, [u]);
  };
  let s;
  r.CSSStyleSheet.prototype.replace && (s = r.CSSStyleSheet.prototype.replace, r.CSSStyleSheet.prototype.replace = function(u) {
    const { id: d, styleId: f } = Wn(this, t, n.styleMirror);
    return (d && d !== -1 || f && f !== -1) && e({
      id: d,
      styleId: f,
      replace: u
    }), s.apply(this, [u]);
  });
  let a;
  r.CSSStyleSheet.prototype.replaceSync && (a = r.CSSStyleSheet.prototype.replaceSync, r.CSSStyleSheet.prototype.replaceSync = function(u) {
    const { id: d, styleId: f } = Wn(this, t, n.styleMirror);
    return (d && d !== -1 || f && f !== -1) && e({
      id: d,
      styleId: f,
      replaceSync: u
    }), a.apply(this, [u]);
  });
  const l = {};
  Mv ? l.CSSGroupingRule = r.CSSGroupingRule : ($v && (l.CSSMediaRule = r.CSSMediaRule), Rv && (l.CSSConditionRule = r.CSSConditionRule), kv && (l.CSSSupportsRule = r.CSSSupportsRule));
  const c = {};
  return Object.entries(l).forEach(([u, d]) => {
    c[u] = {
      insertRule: d.prototype.insertRule,
      deleteRule: d.prototype.deleteRule
    }, d.prototype.insertRule = function(f, m) {
      const { id: h, styleId: p } = Wn(this.parentStyleSheet, t, n.styleMirror);
      return (h && h !== -1 || p && p !== -1) && e({
        id: h,
        styleId: p,
        adds: [
          {
            rule: f,
            index: [
              ...za(this),
              m || 0
            ]
          }
        ]
      }), c[u].insertRule.apply(this, [f, m]);
    }, d.prototype.deleteRule = function(f) {
      const { id: m, styleId: h } = Wn(this.parentStyleSheet, t, n.styleMirror);
      return (m && m !== -1 || h && h !== -1) && e({
        id: m,
        styleId: h,
        removes: [
          { index: [...za(this), f] }
        ]
      }), c[u].deleteRule.apply(this, [f]);
    };
  }), () => {
    r.CSSStyleSheet.prototype.insertRule = o, r.CSSStyleSheet.prototype.deleteRule = i, s && (r.CSSStyleSheet.prototype.replace = s), a && (r.CSSStyleSheet.prototype.replaceSync = a), Object.entries(l).forEach(([u, d]) => {
      d.prototype.insertRule = c[u].insertRule, d.prototype.deleteRule = c[u].deleteRule;
    });
  };
}
function Bv({ mirror: e, stylesheetManager: t }, n) {
  var r, o, i;
  let s = null;
  n.nodeName === "#document" ? s = e.getId(n) : s = e.getId(n.host);
  const a = n.nodeName === "#document" ? (r = n.defaultView) === null || r === void 0 ? void 0 : r.Document : (i = (o = n.ownerDocument) === null || o === void 0 ? void 0 : o.defaultView) === null || i === void 0 ? void 0 : i.ShadowRoot, l = Object.getOwnPropertyDescriptor(a == null ? void 0 : a.prototype, "adoptedStyleSheets");
  return s === null || s === -1 || !a || !l ? () => {
  } : (Object.defineProperty(n, "adoptedStyleSheets", {
    configurable: l.configurable,
    enumerable: l.enumerable,
    get() {
      var c;
      return (c = l.get) === null || c === void 0 ? void 0 : c.call(this);
    },
    set(c) {
      var u;
      const d = (u = l.set) === null || u === void 0 ? void 0 : u.call(this, c);
      if (s !== null && s !== -1)
        try {
          t.adoptStyleSheets(c, s);
        } catch {
        }
      return d;
    }
  }), () => {
    Object.defineProperty(n, "adoptedStyleSheets", {
      configurable: l.configurable,
      enumerable: l.enumerable,
      get: l.get,
      set: l.set
    });
  });
}
function hN({ styleDeclarationCb: e, mirror: t, ignoreCSSAttributes: n, stylesheetManager: r }, { win: o }) {
  const i = o.CSSStyleDeclaration.prototype.setProperty;
  o.CSSStyleDeclaration.prototype.setProperty = function(a, l, c) {
    var u;
    if (n.has(a))
      return i.apply(this, [a, l, c]);
    const { id: d, styleId: f } = Wn((u = this.parentRule) === null || u === void 0 ? void 0 : u.parentStyleSheet, t, r.styleMirror);
    return (d && d !== -1 || f && f !== -1) && e({
      id: d,
      styleId: f,
      set: {
        property: a,
        value: l,
        priority: c
      },
      index: za(this.parentRule)
    }), i.apply(this, [a, l, c]);
  };
  const s = o.CSSStyleDeclaration.prototype.removeProperty;
  return o.CSSStyleDeclaration.prototype.removeProperty = function(a) {
    var l;
    if (n.has(a))
      return s.apply(this, [a]);
    const { id: c, styleId: u } = Wn((l = this.parentRule) === null || l === void 0 ? void 0 : l.parentStyleSheet, t, r.styleMirror);
    return (c && c !== -1 || u && u !== -1) && e({
      id: c,
      styleId: u,
      remove: {
        property: a
      },
      index: za(this.parentRule)
    }), s.apply(this, [a]);
  }, () => {
    o.CSSStyleDeclaration.prototype.setProperty = i, o.CSSStyleDeclaration.prototype.removeProperty = s;
  };
}
function pN({ mediaInteractionCb: e, blockClass: t, blockSelector: n, mirror: r, sampling: o }) {
  const i = (a) => rs((l) => {
    const c = Cs(l);
    if (!c || Mt(c, t, n, !0))
      return;
    const { currentTime: u, volume: d, muted: f, playbackRate: m } = c;
    e({
      type: a,
      id: r.getId(c),
      currentTime: u,
      volume: d,
      muted: f,
      playbackRate: m
    });
  }, o.media || 500), s = [
    Dt("play", i(0)),
    Dt("pause", i(1)),
    Dt("seeked", i(2)),
    Dt("volumechange", i(3)),
    Dt("ratechange", i(4))
  ];
  return () => {
    s.forEach((a) => a());
  };
}
function mN({ fontCb: e, doc: t }) {
  const n = t.defaultView;
  if (!n)
    return () => {
    };
  const r = [], o = /* @__PURE__ */ new WeakMap(), i = n.FontFace;
  n.FontFace = function(l, c, u) {
    const d = new i(l, c, u);
    return o.set(d, {
      family: l,
      buffer: typeof c != "string",
      descriptors: u,
      fontSource: typeof c == "string" ? c : JSON.stringify(Array.from(new Uint8Array(c)))
    }), d;
  };
  const s = ko(t.fonts, "add", function(a) {
    return function(l) {
      return setTimeout(() => {
        const c = o.get(l);
        c && (e(c), o.delete(l));
      }, 0), a.apply(this, [l]);
    };
  });
  return r.push(() => {
    n.FontFace = i;
  }), r.push(s), () => {
    r.forEach((a) => a());
  };
}
function gN(e) {
  const { doc: t, mirror: n, blockClass: r, blockSelector: o, selectionCb: i } = e;
  let s = !0;
  const a = () => {
    const l = t.getSelection();
    if (!l || s && (l != null && l.isCollapsed))
      return;
    s = l.isCollapsed || !1;
    const c = [], u = l.rangeCount || 0;
    for (let d = 0; d < u; d++) {
      const f = l.getRangeAt(d), { startContainer: m, startOffset: h, endContainer: p, endOffset: g } = f;
      Mt(m, r, o, !0) || Mt(p, r, o, !0) || c.push({
        start: n.getId(m),
        startOffset: h,
        end: n.getId(p),
        endOffset: g
      });
    }
    i({ ranges: c });
  };
  return a(), Dt("selectionchange", a);
}
function vN(e, t) {
  const { mutationCb: n, mousemoveCb: r, mouseInteractionCb: o, scrollCb: i, viewportResizeCb: s, inputCb: a, mediaInteractionCb: l, styleSheetRuleCb: c, styleDeclarationCb: u, canvasMutationCb: d, fontCb: f, selectionCb: m } = e;
  e.mutationCb = (...h) => {
    t.mutation && t.mutation(...h), n(...h);
  }, e.mousemoveCb = (...h) => {
    t.mousemove && t.mousemove(...h), r(...h);
  }, e.mouseInteractionCb = (...h) => {
    t.mouseInteraction && t.mouseInteraction(...h), o(...h);
  }, e.scrollCb = (...h) => {
    t.scroll && t.scroll(...h), i(...h);
  }, e.viewportResizeCb = (...h) => {
    t.viewportResize && t.viewportResize(...h), s(...h);
  }, e.inputCb = (...h) => {
    t.input && t.input(...h), a(...h);
  }, e.mediaInteractionCb = (...h) => {
    t.mediaInteaction && t.mediaInteaction(...h), l(...h);
  }, e.styleSheetRuleCb = (...h) => {
    t.styleSheetRule && t.styleSheetRule(...h), c(...h);
  }, e.styleDeclarationCb = (...h) => {
    t.styleDeclaration && t.styleDeclaration(...h), u(...h);
  }, e.canvasMutationCb = (...h) => {
    t.canvasMutation && t.canvasMutation(...h), d(...h);
  }, e.fontCb = (...h) => {
    t.font && t.font(...h), f(...h);
  }, e.selectionCb = (...h) => {
    t.selection && t.selection(...h), m(...h);
  };
}
function yN(e, t = {}) {
  const n = e.doc.defaultView;
  if (!n)
    return () => {
    };
  vN(e, t);
  const r = Pv(e, e.doc), o = aN(e), i = lN(e), s = Fv(e), a = cN(e), l = dN(e), c = pN(e), u = fN(e, { win: n }), d = Bv(e, e.doc), f = hN(e, {
    win: n
  }), m = e.collectFonts ? mN(e) : () => {
  }, h = gN(e), p = [];
  for (const g of e.plugins)
    p.push(g.observer(g.callback, n, g.options));
  return () => {
    _r.forEach((g) => g.reset()), r.disconnect(), o(), i(), s(), a(), l(), c(), u(), d(), f(), m(), h(), p.forEach((g) => g());
  };
}
class Dh {
  constructor(t) {
    this.generateIdFn = t, this.iframeIdToRemoteIdMap = /* @__PURE__ */ new WeakMap(), this.iframeRemoteIdToIdMap = /* @__PURE__ */ new WeakMap();
  }
  getId(t, n, r, o) {
    const i = r || this.getIdToRemoteIdMap(t), s = o || this.getRemoteIdToIdMap(t);
    let a = i.get(n);
    return a || (a = this.generateIdFn(), i.set(n, a), s.set(a, n)), a;
  }
  getIds(t, n) {
    const r = this.getIdToRemoteIdMap(t), o = this.getRemoteIdToIdMap(t);
    return n.map((i) => this.getId(t, i, r, o));
  }
  getRemoteId(t, n, r) {
    const o = r || this.getRemoteIdToIdMap(t);
    if (typeof n != "number")
      return n;
    const i = o.get(n);
    return i || -1;
  }
  getRemoteIds(t, n) {
    const r = this.getRemoteIdToIdMap(t);
    return n.map((o) => this.getRemoteId(t, o, r));
  }
  reset(t) {
    if (!t) {
      this.iframeIdToRemoteIdMap = /* @__PURE__ */ new WeakMap(), this.iframeRemoteIdToIdMap = /* @__PURE__ */ new WeakMap();
      return;
    }
    this.iframeIdToRemoteIdMap.delete(t), this.iframeRemoteIdToIdMap.delete(t);
  }
  getIdToRemoteIdMap(t) {
    let n = this.iframeIdToRemoteIdMap.get(t);
    return n || (n = /* @__PURE__ */ new Map(), this.iframeIdToRemoteIdMap.set(t, n)), n;
  }
  getRemoteIdToIdMap(t) {
    let n = this.iframeRemoteIdToIdMap.get(t);
    return n || (n = /* @__PURE__ */ new Map(), this.iframeRemoteIdToIdMap.set(t, n)), n;
  }
}
class bN {
  constructor(t) {
    this.iframes = /* @__PURE__ */ new WeakMap(), this.crossOriginIframeMap = /* @__PURE__ */ new WeakMap(), this.crossOriginIframeMirror = new Dh(Cv), this.mutationCb = t.mutationCb, this.wrappedEmit = t.wrappedEmit, this.stylesheetManager = t.stylesheetManager, this.recordCrossOriginIframes = t.recordCrossOriginIframes, this.crossOriginIframeStyleMirror = new Dh(this.stylesheetManager.styleMirror.generateId.bind(this.stylesheetManager.styleMirror)), this.mirror = t.mirror, this.recordCrossOriginIframes && window.addEventListener("message", this.handleMessage.bind(this));
  }
  addIframe(t) {
    this.iframes.set(t, !0), t.contentWindow && this.crossOriginIframeMap.set(t.contentWindow, t);
  }
  addLoadListener(t) {
    this.loadListener = t;
  }
  attachIframe(t, n) {
    var r;
    this.mutationCb({
      adds: [
        {
          parentId: this.mirror.getId(t),
          nextId: null,
          node: n
        }
      ],
      removes: [],
      texts: [],
      attributes: [],
      isAttachIframe: !0
    }), (r = this.loadListener) === null || r === void 0 || r.call(this, t), t.contentDocument && t.contentDocument.adoptedStyleSheets && t.contentDocument.adoptedStyleSheets.length > 0 && this.stylesheetManager.adoptStyleSheets(t.contentDocument.adoptedStyleSheets, this.mirror.getId(t.contentDocument));
  }
  handleMessage(t) {
    if (t.data.type === "rrweb") {
      if (!t.source)
        return;
      const r = this.crossOriginIframeMap.get(t.source);
      if (!r)
        return;
      const o = this.transformCrossOriginEvent(r, t.data.event);
      o && this.wrappedEmit(o, t.data.isCheckout);
    }
  }
  transformCrossOriginEvent(t, n) {
    var r;
    switch (n.type) {
      case ke.FullSnapshot:
        return this.crossOriginIframeMirror.reset(t), this.crossOriginIframeStyleMirror.reset(t), this.replaceIdOnNode(n.data.node, t), {
          timestamp: n.timestamp,
          type: ke.IncrementalSnapshot,
          data: {
            source: Ae.Mutation,
            adds: [
              {
                parentId: this.mirror.getId(t),
                nextId: null,
                node: n.data.node
              }
            ],
            removes: [],
            texts: [],
            attributes: [],
            isAttachIframe: !0
          }
        };
      case ke.Meta:
      case ke.Load:
      case ke.DomContentLoaded:
        return !1;
      case ke.Plugin:
        return n;
      case ke.Custom:
        return this.replaceIds(n.data.payload, t, ["id", "parentId", "previousId", "nextId"]), n;
      case ke.IncrementalSnapshot:
        switch (n.data.source) {
          case Ae.Mutation:
            return n.data.adds.forEach((o) => {
              this.replaceIds(o, t, [
                "parentId",
                "nextId",
                "previousId"
              ]), this.replaceIdOnNode(o.node, t);
            }), n.data.removes.forEach((o) => {
              this.replaceIds(o, t, ["parentId", "id"]);
            }), n.data.attributes.forEach((o) => {
              this.replaceIds(o, t, ["id"]);
            }), n.data.texts.forEach((o) => {
              this.replaceIds(o, t, ["id"]);
            }), n;
          case Ae.Drag:
          case Ae.TouchMove:
          case Ae.MouseMove:
            return n.data.positions.forEach((o) => {
              this.replaceIds(o, t, ["id"]);
            }), n;
          case Ae.ViewportResize:
            return !1;
          case Ae.MediaInteraction:
          case Ae.MouseInteraction:
          case Ae.Scroll:
          case Ae.CanvasMutation:
          case Ae.Input:
            return this.replaceIds(n.data, t, ["id"]), n;
          case Ae.StyleSheetRule:
          case Ae.StyleDeclaration:
            return this.replaceIds(n.data, t, ["id"]), this.replaceStyleIds(n.data, t, ["styleId"]), n;
          case Ae.Font:
            return n;
          case Ae.Selection:
            return n.data.ranges.forEach((o) => {
              this.replaceIds(o, t, ["start", "end"]);
            }), n;
          case Ae.AdoptedStyleSheet:
            return this.replaceIds(n.data, t, ["id"]), this.replaceStyleIds(n.data, t, ["styleIds"]), (r = n.data.styles) === null || r === void 0 || r.forEach((o) => {
              this.replaceStyleIds(o, t, ["styleId"]);
            }), n;
        }
    }
  }
  replace(t, n, r, o) {
    for (const i of o)
      !Array.isArray(n[i]) && typeof n[i] != "number" || (Array.isArray(n[i]) ? n[i] = t.getIds(r, n[i]) : n[i] = t.getId(r, n[i]));
    return n;
  }
  replaceIds(t, n, r) {
    return this.replace(this.crossOriginIframeMirror, t, n, r);
  }
  replaceStyleIds(t, n, r) {
    return this.replace(this.crossOriginIframeStyleMirror, t, n, r);
  }
  replaceIdOnNode(t, n) {
    this.replaceIds(t, n, ["id"]), "childNodes" in t && t.childNodes.forEach((r) => {
      this.replaceIdOnNode(r, n);
    });
  }
}
class CN {
  constructor(t) {
    this.shadowDoms = /* @__PURE__ */ new WeakSet(), this.restorePatches = [], this.mutationCb = t.mutationCb, this.scrollCb = t.scrollCb, this.bypassOptions = t.bypassOptions, this.mirror = t.mirror;
    const n = this;
    this.restorePatches.push(ko(Element.prototype, "attachShadow", function(r) {
      return function(o) {
        const i = r.call(this, o);
        return this.shadowRoot && n.addShadowRoot(this.shadowRoot, this.ownerDocument), i;
      };
    }));
  }
  addShadowRoot(t, n) {
    Ai(t) && (this.shadowDoms.has(t) || (this.shadowDoms.add(t), Pv(Object.assign(Object.assign({}, this.bypassOptions), { doc: n, mutationCb: this.mutationCb, mirror: this.mirror, shadowDomManager: this }), t), Fv(Object.assign(Object.assign({}, this.bypassOptions), { scrollCb: this.scrollCb, doc: t, mirror: this.mirror })), setTimeout(() => {
      t.adoptedStyleSheets && t.adoptedStyleSheets.length > 0 && this.bypassOptions.stylesheetManager.adoptStyleSheets(t.adoptedStyleSheets, this.mirror.getId(t.host)), Bv({
        mirror: this.mirror,
        stylesheetManager: this.bypassOptions.stylesheetManager
      }, t);
    }, 0)));
  }
  observeAttachShadow(t) {
    if (t.contentWindow) {
      const n = this;
      this.restorePatches.push(ko(t.contentWindow.HTMLElement.prototype, "attachShadow", function(r) {
        return function(o) {
          const i = r.call(this, o);
          return this.shadowRoot && n.addShadowRoot(this.shadowRoot, t.contentDocument), i;
        };
      }));
    }
  }
  reset() {
    this.restorePatches.forEach((t) => t()), this.shadowDoms = /* @__PURE__ */ new WeakSet();
  }
}
/*! *****************************************************************************
Copyright (c) Microsoft Corporation.

Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted.

THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
PERFORMANCE OF THIS SOFTWARE.
***************************************************************************** */
function wN(e, t) {
  var n = {};
  for (var r in e)
    Object.prototype.hasOwnProperty.call(e, r) && t.indexOf(r) < 0 && (n[r] = e[r]);
  if (e != null && typeof Object.getOwnPropertySymbols == "function")
    for (var o = 0, r = Object.getOwnPropertySymbols(e); o < r.length; o++)
      t.indexOf(r[o]) < 0 && Object.prototype.propertyIsEnumerable.call(e, r[o]) && (n[r[o]] = e[r[o]]);
  return n;
}
function xN(e, t, n, r) {
  function o(i) {
    return i instanceof n ? i : new n(function(s) {
      s(i);
    });
  }
  return new (n || (n = Promise))(function(i, s) {
    function a(u) {
      try {
        c(r.next(u));
      } catch (d) {
        s(d);
      }
    }
    function l(u) {
      try {
        c(r.throw(u));
      } catch (d) {
        s(d);
      }
    }
    function c(u) {
      u.done ? i(u.value) : o(u.value).then(a, l);
    }
    c((r = r.apply(e, t || [])).next());
  });
}
var vo = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/", SN = typeof Uint8Array > "u" ? [] : new Uint8Array(256);
for (var Zs = 0; Zs < vo.length; Zs++)
  SN[vo.charCodeAt(Zs)] = Zs;
var EN = function(e) {
  var t = new Uint8Array(e), n, r = t.length, o = "";
  for (n = 0; n < r; n += 3)
    o += vo[t[n] >> 2], o += vo[(t[n] & 3) << 4 | t[n + 1] >> 4], o += vo[(t[n + 1] & 15) << 2 | t[n + 2] >> 6], o += vo[t[n + 2] & 63];
  return r % 3 === 2 ? o = o.substring(0, o.length - 1) + "=" : r % 3 === 1 && (o = o.substring(0, o.length - 2) + "=="), o;
};
const Mh = /* @__PURE__ */ new Map();
function _N(e, t) {
  let n = Mh.get(e);
  return n || (n = /* @__PURE__ */ new Map(), Mh.set(e, n)), n.has(t) || n.set(t, []), n.get(t);
}
const Lv = (e, t, n) => {
  if (!e || !(zv(e, t) || typeof e == "object"))
    return;
  const r = e.constructor.name, o = _N(n, r);
  let i = o.indexOf(e);
  return i === -1 && (i = o.length, o.push(e)), i;
};
function pa(e, t, n) {
  if (e instanceof Array)
    return e.map((r) => pa(r, t, n));
  if (e === null)
    return e;
  if (e instanceof Float32Array || e instanceof Float64Array || e instanceof Int32Array || e instanceof Uint32Array || e instanceof Uint8Array || e instanceof Uint16Array || e instanceof Int16Array || e instanceof Int8Array || e instanceof Uint8ClampedArray)
    return {
      rr_type: e.constructor.name,
      args: [Object.values(e)]
    };
  if (e instanceof ArrayBuffer) {
    const r = e.constructor.name, o = EN(e);
    return {
      rr_type: r,
      base64: o
    };
  } else {
    if (e instanceof DataView)
      return {
        rr_type: e.constructor.name,
        args: [
          pa(e.buffer, t, n),
          e.byteOffset,
          e.byteLength
        ]
      };
    if (e instanceof HTMLImageElement) {
      const r = e.constructor.name, { src: o } = e;
      return {
        rr_type: r,
        src: o
      };
    } else if (e instanceof HTMLCanvasElement) {
      const r = "HTMLImageElement", o = e.toDataURL();
      return {
        rr_type: r,
        src: o
      };
    } else {
      if (e instanceof ImageData)
        return {
          rr_type: e.constructor.name,
          args: [pa(e.data, t, n), e.width, e.height]
        };
      if (zv(e, t) || typeof e == "object") {
        const r = e.constructor.name, o = Lv(e, t, n);
        return {
          rr_type: r,
          index: o
        };
      }
    }
  }
  return e;
}
const Vv = (e, t, n) => [...e].map((r) => pa(r, t, n)), zv = (e, t) => !![
  "WebGLActiveInfo",
  "WebGLBuffer",
  "WebGLFramebuffer",
  "WebGLProgram",
  "WebGLRenderbuffer",
  "WebGLShader",
  "WebGLShaderPrecisionFormat",
  "WebGLTexture",
  "WebGLUniformLocation",
  "WebGLVertexArrayObject",
  "WebGLVertexArrayObjectOES"
].filter((o) => typeof t[o] == "function").find((o) => e instanceof t[o]);
function IN(e, t, n, r) {
  const o = [], i = Object.getOwnPropertyNames(t.CanvasRenderingContext2D.prototype);
  for (const s of i)
    try {
      if (typeof t.CanvasRenderingContext2D.prototype[s] != "function")
        continue;
      const a = ko(t.CanvasRenderingContext2D.prototype, s, function(l) {
        return function(...c) {
          return Mt(this.canvas, n, r, !0) || setTimeout(() => {
            const u = Vv([...c], t, this);
            e(this.canvas, {
              type: Ro["2D"],
              property: s,
              args: u
            });
          }, 0), l.apply(this, c);
        };
      });
      o.push(a);
    } catch {
      const l = wl(t.CanvasRenderingContext2D.prototype, s, {
        set(c) {
          e(this.canvas, {
            type: Ro["2D"],
            property: s,
            args: [c],
            setter: !0
          });
        }
      });
      o.push(l);
    }
  return () => {
    o.forEach((s) => s());
  };
}
function $h(e, t, n) {
  const r = [];
  try {
    const o = ko(e.HTMLCanvasElement.prototype, "getContext", function(i) {
      return function(s, ...a) {
        return Mt(this, t, n, !0) || "__context" in this || (this.__context = s), i.apply(this, [s, ...a]);
      };
    });
    r.push(o);
  } catch {
    console.error("failed to patch HTMLCanvasElement.prototype.getContext");
  }
  return () => {
    r.forEach((o) => o());
  };
}
function kh(e, t, n, r, o, i, s) {
  const a = [], l = Object.getOwnPropertyNames(e);
  for (const c of l)
    if (![
      "isContextLost",
      "canvas",
      "drawingBufferWidth",
      "drawingBufferHeight"
    ].includes(c))
      try {
        if (typeof e[c] != "function")
          continue;
        const u = ko(e, c, function(d) {
          return function(...f) {
            const m = d.apply(this, f);
            if (Lv(m, s, this), !Mt(this.canvas, r, o, !0)) {
              const h = Vv([...f], s, this), p = {
                type: t,
                property: c,
                args: h
              };
              n(this.canvas, p);
            }
            return m;
          };
        });
        a.push(u);
      } catch {
        const d = wl(e, c, {
          set(f) {
            n(this.canvas, {
              type: t,
              property: c,
              args: [f],
              setter: !0
            });
          }
        });
        a.push(d);
      }
  return a;
}
function NN(e, t, n, r, o) {
  const i = [];
  return i.push(...kh(t.WebGLRenderingContext.prototype, Ro.WebGL, e, n, r, o, t)), typeof t.WebGL2RenderingContext < "u" && i.push(...kh(t.WebGL2RenderingContext.prototype, Ro.WebGL2, e, n, r, o, t)), () => {
    i.forEach((s) => s());
  };
}
var jv = null;
try {
  var TN = typeof module < "u" && typeof module.require == "function" && module.require("worker_threads") || typeof __non_webpack_require__ == "function" && __non_webpack_require__("worker_threads") || typeof require == "function" && require("worker_threads");
  jv = TN.Worker;
} catch {
}
function ON(e, t) {
  return Buffer.from(e, "base64").toString(t ? "utf16" : "utf8");
}
function AN(e, t, n) {
  var r = t === void 0 ? null : t, o = n === void 0 ? !1 : n, i = ON(e, o), s = i.indexOf(`
`, 10) + 1, a = i.substring(s) + (r ? "//# sourceMappingURL=" + r : "");
  return function(c) {
    return new jv(a, Object.assign({}, c, { eval: !0 }));
  };
}
function DN(e, t) {
  var n = atob(e);
  if (t) {
    for (var r = new Uint8Array(n.length), o = 0, i = n.length; o < i; ++o)
      r[o] = n.charCodeAt(o);
    return String.fromCharCode.apply(null, new Uint16Array(r.buffer));
  }
  return n;
}
function MN(e, t, n) {
  var r = t === void 0 ? null : t, o = n === void 0 ? !1 : n, i = DN(e, o), s = i.indexOf(`
`, 10) + 1, a = i.substring(s) + (r ? "//# sourceMappingURL=" + r : ""), l = new Blob([a], { type: "application/javascript" });
  return URL.createObjectURL(l);
}
function $N(e, t, n) {
  var r;
  return function(i) {
    return r = r || MN(e, t, n), new Worker(r, i);
  };
}
var kN = Object.prototype.toString.call(typeof process < "u" ? process : 0) === "[object process]";
function RN() {
  return kN;
}
function PN(e, t, n) {
  return RN() ? AN(e, t, n) : $N(e, t, n);
}
var FN = PN("Lyogcm9sbHVwLXBsdWdpbi13ZWItd29ya2VyLWxvYWRlciAqLwooZnVuY3Rpb24gKCkgewogICAgJ3VzZSBzdHJpY3QnOwoKICAgIC8qISAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKg0KICAgIENvcHlyaWdodCAoYykgTWljcm9zb2Z0IENvcnBvcmF0aW9uLg0KDQogICAgUGVybWlzc2lvbiB0byB1c2UsIGNvcHksIG1vZGlmeSwgYW5kL29yIGRpc3RyaWJ1dGUgdGhpcyBzb2Z0d2FyZSBmb3IgYW55DQogICAgcHVycG9zZSB3aXRoIG9yIHdpdGhvdXQgZmVlIGlzIGhlcmVieSBncmFudGVkLg0KDQogICAgVEhFIFNPRlRXQVJFIElTIFBST1ZJREVEICJBUyBJUyIgQU5EIFRIRSBBVVRIT1IgRElTQ0xBSU1TIEFMTCBXQVJSQU5USUVTIFdJVEgNCiAgICBSRUdBUkQgVE8gVEhJUyBTT0ZUV0FSRSBJTkNMVURJTkcgQUxMIElNUExJRUQgV0FSUkFOVElFUyBPRiBNRVJDSEFOVEFCSUxJVFkNCiAgICBBTkQgRklUTkVTUy4gSU4gTk8gRVZFTlQgU0hBTEwgVEhFIEFVVEhPUiBCRSBMSUFCTEUgRk9SIEFOWSBTUEVDSUFMLCBESVJFQ1QsDQogICAgSU5ESVJFQ1QsIE9SIENPTlNFUVVFTlRJQUwgREFNQUdFUyBPUiBBTlkgREFNQUdFUyBXSEFUU09FVkVSIFJFU1VMVElORyBGUk9NDQogICAgTE9TUyBPRiBVU0UsIERBVEEgT1IgUFJPRklUUywgV0hFVEhFUiBJTiBBTiBBQ1RJT04gT0YgQ09OVFJBQ1QsIE5FR0xJR0VOQ0UgT1INCiAgICBPVEhFUiBUT1JUSU9VUyBBQ1RJT04sIEFSSVNJTkcgT1VUIE9GIE9SIElOIENPTk5FQ1RJT04gV0lUSCBUSEUgVVNFIE9SDQogICAgUEVSRk9STUFOQ0UgT0YgVEhJUyBTT0ZUV0FSRS4NCiAgICAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLw0KDQogICAgZnVuY3Rpb24gX19hd2FpdGVyKHRoaXNBcmcsIF9hcmd1bWVudHMsIFAsIGdlbmVyYXRvcikgew0KICAgICAgICBmdW5jdGlvbiBhZG9wdCh2YWx1ZSkgeyByZXR1cm4gdmFsdWUgaW5zdGFuY2VvZiBQID8gdmFsdWUgOiBuZXcgUChmdW5jdGlvbiAocmVzb2x2ZSkgeyByZXNvbHZlKHZhbHVlKTsgfSk7IH0NCiAgICAgICAgcmV0dXJuIG5ldyAoUCB8fCAoUCA9IFByb21pc2UpKShmdW5jdGlvbiAocmVzb2x2ZSwgcmVqZWN0KSB7DQogICAgICAgICAgICBmdW5jdGlvbiBmdWxmaWxsZWQodmFsdWUpIHsgdHJ5IHsgc3RlcChnZW5lcmF0b3IubmV4dCh2YWx1ZSkpOyB9IGNhdGNoIChlKSB7IHJlamVjdChlKTsgfSB9DQogICAgICAgICAgICBmdW5jdGlvbiByZWplY3RlZCh2YWx1ZSkgeyB0cnkgeyBzdGVwKGdlbmVyYXRvclsidGhyb3ciXSh2YWx1ZSkpOyB9IGNhdGNoIChlKSB7IHJlamVjdChlKTsgfSB9DQogICAgICAgICAgICBmdW5jdGlvbiBzdGVwKHJlc3VsdCkgeyByZXN1bHQuZG9uZSA/IHJlc29sdmUocmVzdWx0LnZhbHVlKSA6IGFkb3B0KHJlc3VsdC52YWx1ZSkudGhlbihmdWxmaWxsZWQsIHJlamVjdGVkKTsgfQ0KICAgICAgICAgICAgc3RlcCgoZ2VuZXJhdG9yID0gZ2VuZXJhdG9yLmFwcGx5KHRoaXNBcmcsIF9hcmd1bWVudHMgfHwgW10pKS5uZXh0KCkpOw0KICAgICAgICB9KTsNCiAgICB9CgogICAgLyoKICAgICAqIGJhc2U2NC1hcnJheWJ1ZmZlciAxLjAuMSA8aHR0cHM6Ly9naXRodWIuY29tL25pa2xhc3ZoL2Jhc2U2NC1hcnJheWJ1ZmZlcj4KICAgICAqIENvcHlyaWdodCAoYykgMjAyMSBOaWtsYXMgdm9uIEhlcnR6ZW4gPGh0dHBzOi8vaGVydHplbi5jb20+CiAgICAgKiBSZWxlYXNlZCB1bmRlciBNSVQgTGljZW5zZQogICAgICovCiAgICB2YXIgY2hhcnMgPSAnQUJDREVGR0hJSktMTU5PUFFSU1RVVldYWVphYmNkZWZnaGlqa2xtbm9wcXJzdHV2d3h5ejAxMjM0NTY3ODkrLyc7CiAgICAvLyBVc2UgYSBsb29rdXAgdGFibGUgdG8gZmluZCB0aGUgaW5kZXguCiAgICB2YXIgbG9va3VwID0gdHlwZW9mIFVpbnQ4QXJyYXkgPT09ICd1bmRlZmluZWQnID8gW10gOiBuZXcgVWludDhBcnJheSgyNTYpOwogICAgZm9yICh2YXIgaSA9IDA7IGkgPCBjaGFycy5sZW5ndGg7IGkrKykgewogICAgICAgIGxvb2t1cFtjaGFycy5jaGFyQ29kZUF0KGkpXSA9IGk7CiAgICB9CiAgICB2YXIgZW5jb2RlID0gZnVuY3Rpb24gKGFycmF5YnVmZmVyKSB7CiAgICAgICAgdmFyIGJ5dGVzID0gbmV3IFVpbnQ4QXJyYXkoYXJyYXlidWZmZXIpLCBpLCBsZW4gPSBieXRlcy5sZW5ndGgsIGJhc2U2NCA9ICcnOwogICAgICAgIGZvciAoaSA9IDA7IGkgPCBsZW47IGkgKz0gMykgewogICAgICAgICAgICBiYXNlNjQgKz0gY2hhcnNbYnl0ZXNbaV0gPj4gMl07CiAgICAgICAgICAgIGJhc2U2NCArPSBjaGFyc1soKGJ5dGVzW2ldICYgMykgPDwgNCkgfCAoYnl0ZXNbaSArIDFdID4+IDQpXTsKICAgICAgICAgICAgYmFzZTY0ICs9IGNoYXJzWygoYnl0ZXNbaSArIDFdICYgMTUpIDw8IDIpIHwgKGJ5dGVzW2kgKyAyXSA+PiA2KV07CiAgICAgICAgICAgIGJhc2U2NCArPSBjaGFyc1tieXRlc1tpICsgMl0gJiA2M107CiAgICAgICAgfQogICAgICAgIGlmIChsZW4gJSAzID09PSAyKSB7CiAgICAgICAgICAgIGJhc2U2NCA9IGJhc2U2NC5zdWJzdHJpbmcoMCwgYmFzZTY0Lmxlbmd0aCAtIDEpICsgJz0nOwogICAgICAgIH0KICAgICAgICBlbHNlIGlmIChsZW4gJSAzID09PSAxKSB7CiAgICAgICAgICAgIGJhc2U2NCA9IGJhc2U2NC5zdWJzdHJpbmcoMCwgYmFzZTY0Lmxlbmd0aCAtIDIpICsgJz09JzsKICAgICAgICB9CiAgICAgICAgcmV0dXJuIGJhc2U2NDsKICAgIH07CgogICAgY29uc3QgbGFzdEJsb2JNYXAgPSBuZXcgTWFwKCk7DQogICAgY29uc3QgdHJhbnNwYXJlbnRCbG9iTWFwID0gbmV3IE1hcCgpOw0KICAgIGZ1bmN0aW9uIGdldFRyYW5zcGFyZW50QmxvYkZvcih3aWR0aCwgaGVpZ2h0LCBkYXRhVVJMT3B0aW9ucykgew0KICAgICAgICByZXR1cm4gX19hd2FpdGVyKHRoaXMsIHZvaWQgMCwgdm9pZCAwLCBmdW5jdGlvbiogKCkgew0KICAgICAgICAgICAgY29uc3QgaWQgPSBgJHt3aWR0aH0tJHtoZWlnaHR9YDsNCiAgICAgICAgICAgIGlmICgnT2Zmc2NyZWVuQ2FudmFzJyBpbiBnbG9iYWxUaGlzKSB7DQogICAgICAgICAgICAgICAgaWYgKHRyYW5zcGFyZW50QmxvYk1hcC5oYXMoaWQpKQ0KICAgICAgICAgICAgICAgICAgICByZXR1cm4gdHJhbnNwYXJlbnRCbG9iTWFwLmdldChpZCk7DQogICAgICAgICAgICAgICAgY29uc3Qgb2Zmc2NyZWVuID0gbmV3IE9mZnNjcmVlbkNhbnZhcyh3aWR0aCwgaGVpZ2h0KTsNCiAgICAgICAgICAgICAgICBvZmZzY3JlZW4uZ2V0Q29udGV4dCgnMmQnKTsNCiAgICAgICAgICAgICAgICBjb25zdCBibG9iID0geWllbGQgb2Zmc2NyZWVuLmNvbnZlcnRUb0Jsb2IoZGF0YVVSTE9wdGlvbnMpOw0KICAgICAgICAgICAgICAgIGNvbnN0IGFycmF5QnVmZmVyID0geWllbGQgYmxvYi5hcnJheUJ1ZmZlcigpOw0KICAgICAgICAgICAgICAgIGNvbnN0IGJhc2U2NCA9IGVuY29kZShhcnJheUJ1ZmZlcik7DQogICAgICAgICAgICAgICAgdHJhbnNwYXJlbnRCbG9iTWFwLnNldChpZCwgYmFzZTY0KTsNCiAgICAgICAgICAgICAgICByZXR1cm4gYmFzZTY0Ow0KICAgICAgICAgICAgfQ0KICAgICAgICAgICAgZWxzZSB7DQogICAgICAgICAgICAgICAgcmV0dXJuICcnOw0KICAgICAgICAgICAgfQ0KICAgICAgICB9KTsNCiAgICB9DQogICAgY29uc3Qgd29ya2VyID0gc2VsZjsNCiAgICB3b3JrZXIub25tZXNzYWdlID0gZnVuY3Rpb24gKGUpIHsNCiAgICAgICAgcmV0dXJuIF9fYXdhaXRlcih0aGlzLCB2b2lkIDAsIHZvaWQgMCwgZnVuY3Rpb24qICgpIHsNCiAgICAgICAgICAgIGlmICgnT2Zmc2NyZWVuQ2FudmFzJyBpbiBnbG9iYWxUaGlzKSB7DQogICAgICAgICAgICAgICAgY29uc3QgeyBpZCwgYml0bWFwLCB3aWR0aCwgaGVpZ2h0LCBkYXRhVVJMT3B0aW9ucyB9ID0gZS5kYXRhOw0KICAgICAgICAgICAgICAgIGNvbnN0IHRyYW5zcGFyZW50QmFzZTY0ID0gZ2V0VHJhbnNwYXJlbnRCbG9iRm9yKHdpZHRoLCBoZWlnaHQsIGRhdGFVUkxPcHRpb25zKTsNCiAgICAgICAgICAgICAgICBjb25zdCBvZmZzY3JlZW4gPSBuZXcgT2Zmc2NyZWVuQ2FudmFzKHdpZHRoLCBoZWlnaHQpOw0KICAgICAgICAgICAgICAgIGNvbnN0IGN0eCA9IG9mZnNjcmVlbi5nZXRDb250ZXh0KCcyZCcpOw0KICAgICAgICAgICAgICAgIGN0eC5kcmF3SW1hZ2UoYml0bWFwLCAwLCAwKTsNCiAgICAgICAgICAgICAgICBiaXRtYXAuY2xvc2UoKTsNCiAgICAgICAgICAgICAgICBjb25zdCBibG9iID0geWllbGQgb2Zmc2NyZWVuLmNvbnZlcnRUb0Jsb2IoZGF0YVVSTE9wdGlvbnMpOw0KICAgICAgICAgICAgICAgIGNvbnN0IHR5cGUgPSBibG9iLnR5cGU7DQogICAgICAgICAgICAgICAgY29uc3QgYXJyYXlCdWZmZXIgPSB5aWVsZCBibG9iLmFycmF5QnVmZmVyKCk7DQogICAgICAgICAgICAgICAgY29uc3QgYmFzZTY0ID0gZW5jb2RlKGFycmF5QnVmZmVyKTsNCiAgICAgICAgICAgICAgICBpZiAoIWxhc3RCbG9iTWFwLmhhcyhpZCkgJiYgKHlpZWxkIHRyYW5zcGFyZW50QmFzZTY0KSA9PT0gYmFzZTY0KSB7DQogICAgICAgICAgICAgICAgICAgIGxhc3RCbG9iTWFwLnNldChpZCwgYmFzZTY0KTsNCiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHdvcmtlci5wb3N0TWVzc2FnZSh7IGlkIH0pOw0KICAgICAgICAgICAgICAgIH0NCiAgICAgICAgICAgICAgICBpZiAobGFzdEJsb2JNYXAuZ2V0KGlkKSA9PT0gYmFzZTY0KQ0KICAgICAgICAgICAgICAgICAgICByZXR1cm4gd29ya2VyLnBvc3RNZXNzYWdlKHsgaWQgfSk7DQogICAgICAgICAgICAgICAgd29ya2VyLnBvc3RNZXNzYWdlKHsNCiAgICAgICAgICAgICAgICAgICAgaWQsDQogICAgICAgICAgICAgICAgICAgIHR5cGUsDQogICAgICAgICAgICAgICAgICAgIGJhc2U2NCwNCiAgICAgICAgICAgICAgICAgICAgd2lkdGgsDQogICAgICAgICAgICAgICAgICAgIGhlaWdodCwNCiAgICAgICAgICAgICAgICB9KTsNCiAgICAgICAgICAgICAgICBsYXN0QmxvYk1hcC5zZXQoaWQsIGJhc2U2NCk7DQogICAgICAgICAgICB9DQogICAgICAgICAgICBlbHNlIHsNCiAgICAgICAgICAgICAgICByZXR1cm4gd29ya2VyLnBvc3RNZXNzYWdlKHsgaWQ6IGUuZGF0YS5pZCB9KTsNCiAgICAgICAgICAgIH0NCiAgICAgICAgfSk7DQogICAgfTsKCn0pKCk7Cgo=", null, !1);
class BN {
  constructor(t) {
    this.pendingCanvasMutations = /* @__PURE__ */ new Map(), this.rafStamps = { latestId: 0, invokeId: null }, this.frozen = !1, this.locked = !1, this.processMutation = (l, c) => {
      (this.rafStamps.invokeId && this.rafStamps.latestId !== this.rafStamps.invokeId || !this.rafStamps.invokeId) && (this.rafStamps.invokeId = this.rafStamps.latestId), this.pendingCanvasMutations.has(l) || this.pendingCanvasMutations.set(l, []), this.pendingCanvasMutations.get(l).push(c);
    };
    const { sampling: n = "all", win: r, blockClass: o, blockSelector: i, recordCanvas: s, dataURLOptions: a } = t;
    this.mutationCb = t.mutationCb, this.mirror = t.mirror, s && n === "all" && this.initCanvasMutationObserver(r, o, i), s && typeof n == "number" && this.initCanvasFPSObserver(n, r, o, i, {
      dataURLOptions: a
    });
  }
  reset() {
    this.pendingCanvasMutations.clear(), this.resetObservers && this.resetObservers();
  }
  freeze() {
    this.frozen = !0;
  }
  unfreeze() {
    this.frozen = !1;
  }
  lock() {
    this.locked = !0;
  }
  unlock() {
    this.locked = !1;
  }
  initCanvasFPSObserver(t, n, r, o, i) {
    const s = $h(n, r, o), a = /* @__PURE__ */ new Map(), l = new FN();
    l.onmessage = (h) => {
      const { id: p } = h.data;
      if (a.set(p, !1), !("base64" in h.data))
        return;
      const { base64: g, type: v, width: y, height: b } = h.data;
      this.mutationCb({
        id: p,
        type: Ro["2D"],
        commands: [
          {
            property: "clearRect",
            args: [0, 0, y, b]
          },
          {
            property: "drawImage",
            args: [
              {
                rr_type: "ImageBitmap",
                args: [
                  {
                    rr_type: "Blob",
                    data: [{ rr_type: "ArrayBuffer", base64: g }],
                    type: v
                  }
                ]
              },
              0,
              0
            ]
          }
        ]
      });
    };
    const c = 1e3 / t;
    let u = 0, d;
    const f = () => {
      const h = [];
      return n.document.querySelectorAll("canvas").forEach((p) => {
        Mt(p, r, o, !0) || h.push(p);
      }), h;
    }, m = (h) => {
      if (u && h - u < c) {
        d = requestAnimationFrame(m);
        return;
      }
      u = h, f().forEach((p) => xN(this, void 0, void 0, function* () {
        var g;
        const v = this.mirror.getId(p);
        if (a.get(v))
          return;
        if (a.set(v, !0), ["webgl", "webgl2"].includes(p.__context)) {
          const b = p.getContext(p.__context);
          ((g = b == null ? void 0 : b.getContextAttributes()) === null || g === void 0 ? void 0 : g.preserveDrawingBuffer) === !1 && (b == null || b.clear(b.COLOR_BUFFER_BIT));
        }
        const y = yield createImageBitmap(p);
        l.postMessage({
          id: v,
          bitmap: y,
          width: p.width,
          height: p.height,
          dataURLOptions: i.dataURLOptions
        }, [y]);
      })), d = requestAnimationFrame(m);
    };
    d = requestAnimationFrame(m), this.resetObservers = () => {
      s(), cancelAnimationFrame(d);
    };
  }
  initCanvasMutationObserver(t, n, r) {
    this.startRAFTimestamping(), this.startPendingCanvasMutationFlusher();
    const o = $h(t, n, r), i = IN(this.processMutation.bind(this), t, n, r), s = NN(this.processMutation.bind(this), t, n, r, this.mirror);
    this.resetObservers = () => {
      o(), i(), s();
    };
  }
  startPendingCanvasMutationFlusher() {
    requestAnimationFrame(() => this.flushPendingCanvasMutations());
  }
  startRAFTimestamping() {
    const t = (n) => {
      this.rafStamps.latestId = n, requestAnimationFrame(t);
    };
    requestAnimationFrame(t);
  }
  flushPendingCanvasMutations() {
    this.pendingCanvasMutations.forEach((t, n) => {
      const r = this.mirror.getId(n);
      this.flushPendingCanvasMutationFor(n, r);
    }), requestAnimationFrame(() => this.flushPendingCanvasMutations());
  }
  flushPendingCanvasMutationFor(t, n) {
    if (this.frozen || this.locked)
      return;
    const r = this.pendingCanvasMutations.get(t);
    if (!r || n === -1)
      return;
    const o = r.map((s) => wN(s, ["type"])), { type: i } = r[0];
    this.mutationCb({ id: n, type: i, commands: o }), this.pendingCanvasMutations.delete(t);
  }
}
class LN {
  constructor(t) {
    this.trackedLinkElements = /* @__PURE__ */ new WeakSet(), this.styleMirror = new oN(), this.mutationCb = t.mutationCb, this.adoptedStyleSheetCb = t.adoptedStyleSheetCb;
  }
  attachLinkElement(t, n) {
    "_cssText" in n.attributes && this.mutationCb({
      adds: [],
      removes: [],
      texts: [],
      attributes: [
        {
          id: n.id,
          attributes: n.attributes
        }
      ]
    }), this.trackLinkElement(t);
  }
  trackLinkElement(t) {
    this.trackedLinkElements.has(t) || (this.trackedLinkElements.add(t), this.trackStylesheetInLinkElement(t));
  }
  adoptStyleSheets(t, n) {
    if (t.length === 0)
      return;
    const r = {
      id: n,
      styleIds: []
    }, o = [];
    for (const i of t) {
      let s;
      if (this.styleMirror.has(i))
        s = this.styleMirror.getId(i);
      else {
        s = this.styleMirror.add(i);
        const a = Array.from(i.rules || CSSRule);
        o.push({
          styleId: s,
          rules: a.map((l, c) => ({
            rule: yv(l),
            index: c
          }))
        });
      }
      r.styleIds.push(s);
    }
    o.length > 0 && (r.styles = o), this.adoptedStyleSheetCb(r);
  }
  reset() {
    this.styleMirror.reset(), this.trackedLinkElements = /* @__PURE__ */ new WeakSet();
  }
  trackStylesheetInLinkElement(t) {
  }
}
function lt(e) {
  return Object.assign(Object.assign({}, e), { timestamp: Date.now() });
}
let rt, ma, Gl, ja = !1;
const Yt = $I();
function ws(e = {}) {
  const { emit: t, checkoutEveryNms: n, checkoutEveryNth: r, blockClass: o = "rr-block", blockSelector: i = null, ignoreClass: s = "rr-ignore", maskTextClass: a = "rr-mask", maskTextSelector: l = null, inlineStylesheet: c = !0, maskAllInputs: u, maskInputOptions: d, slimDOMOptions: f, maskInputFn: m, maskTextFn: h, hooks: p, packFn: g, sampling: v = {}, dataURLOptions: y = {}, mousemoveWait: b, recordCanvas: E = !1, recordCrossOriginIframes: S = !1, userTriggeredOnInput: T = !1, collectFonts: C = !1, inlineImages: _ = !1, plugins: w, keepIframeSrcFn: R = () => !1, ignoreCSSAttributes: O = /* @__PURE__ */ new Set([]) } = e, I = S ? window.parent === window : !0;
  let L = !1;
  if (!I)
    try {
      window.parent.document, L = !1;
    } catch {
      L = !0;
    }
  if (I && !t)
    throw new Error("emit function is required");
  b !== void 0 && v.mousemove === void 0 && (v.mousemove = b), Yt.reset();
  const D = u === !0 ? {
    color: !0,
    date: !0,
    "datetime-local": !0,
    email: !0,
    month: !0,
    number: !0,
    range: !0,
    search: !0,
    tel: !0,
    text: !0,
    time: !0,
    url: !0,
    week: !0,
    textarea: !0,
    select: !0,
    password: !0
  } : d !== void 0 ? d : { password: !0 }, P = f === !0 || f === "all" ? {
    script: !0,
    comment: !0,
    headFavicon: !0,
    headWhitespace: !0,
    headMetaSocial: !0,
    headMetaRobots: !0,
    headMetaHttpEquiv: !0,
    headMetaVerification: !0,
    headMetaAuthorship: f === "all",
    headMetaDescKeywords: f === "all"
  } : f || {};
  rN();
  let k, N = 0;
  const $ = (j) => {
    for (const pe of w || [])
      pe.eventProcessor && (j = pe.eventProcessor(j));
    return g && (j = g(j)), j;
  };
  rt = (j, pe) => {
    var ne;
    if (!((ne = _r[0]) === null || ne === void 0) && ne.isFrozen() && j.type !== ke.FullSnapshot && !(j.type === ke.IncrementalSnapshot && j.data.source === Ae.Mutation) && _r.forEach((ee) => ee.unfreeze()), I)
      t == null || t($(j), pe);
    else if (L) {
      const ee = {
        type: "rrweb",
        event: $(j),
        isCheckout: pe
      };
      window.parent.postMessage(ee, "*");
    }
    if (j.type === ke.FullSnapshot)
      k = j, N = 0;
    else if (j.type === ke.IncrementalSnapshot) {
      if (j.data.source === Ae.Mutation && j.data.isAttachIframe)
        return;
      N++;
      const ee = r && N >= r, we = n && j.timestamp - k.timestamp > n;
      (ee || we) && ma(!0);
    }
  };
  const B = (j) => {
    rt(lt({
      type: ke.IncrementalSnapshot,
      data: Object.assign({ source: Ae.Mutation }, j)
    }));
  }, U = (j) => rt(lt({
    type: ke.IncrementalSnapshot,
    data: Object.assign({ source: Ae.Scroll }, j)
  })), J = (j) => rt(lt({
    type: ke.IncrementalSnapshot,
    data: Object.assign({ source: Ae.CanvasMutation }, j)
  })), te = (j) => rt(lt({
    type: ke.IncrementalSnapshot,
    data: Object.assign({ source: Ae.AdoptedStyleSheet }, j)
  })), ie = new LN({
    mutationCb: B,
    adoptedStyleSheetCb: te
  }), z = new bN({
    mirror: Yt,
    mutationCb: B,
    stylesheetManager: ie,
    recordCrossOriginIframes: S,
    wrappedEmit: rt
  });
  for (const j of w || [])
    j.getMirror && j.getMirror({
      nodeMirror: Yt,
      crossOriginIframeMirror: z.crossOriginIframeMirror,
      crossOriginIframeStyleMirror: z.crossOriginIframeStyleMirror
    });
  Gl = new BN({
    recordCanvas: E,
    mutationCb: J,
    win: window,
    blockClass: o,
    blockSelector: i,
    mirror: Yt,
    sampling: v.canvas,
    dataURLOptions: y
  });
  const le = new CN({
    mutationCb: B,
    scrollCb: U,
    bypassOptions: {
      blockClass: o,
      blockSelector: i,
      maskTextClass: a,
      maskTextSelector: l,
      inlineStylesheet: c,
      maskInputOptions: D,
      dataURLOptions: y,
      maskTextFn: h,
      maskInputFn: m,
      recordCanvas: E,
      inlineImages: _,
      sampling: v,
      slimDOMOptions: P,
      iframeManager: z,
      stylesheetManager: ie,
      canvasManager: Gl,
      keepIframeSrcFn: R
    },
    mirror: Yt
  });
  ma = (j = !1) => {
    var pe, ne, ee, we, me, De;
    rt(lt({
      type: ke.Meta,
      data: {
        href: window.location.href,
        width: Ev(),
        height: Sv()
      }
    }), j), ie.reset(), _r.forEach((A) => A.lock());
    const x = tN(document, {
      mirror: Yt,
      blockClass: o,
      blockSelector: i,
      maskTextClass: a,
      maskTextSelector: l,
      inlineStylesheet: c,
      maskAllInputs: D,
      maskTextFn: h,
      slimDOM: P,
      dataURLOptions: y,
      recordCanvas: E,
      inlineImages: _,
      onSerialize: (A) => {
        Nv(A, Yt) && z.addIframe(A), Tv(A, Yt) && ie.trackLinkElement(A), Ov(A) && le.addShadowRoot(A.shadowRoot, document);
      },
      onIframeLoad: (A, F) => {
        z.attachIframe(A, F), le.observeAttachShadow(A);
      },
      onStylesheetLoad: (A, F) => {
        ie.attachLinkElement(A, F);
      },
      keepIframeSrcFn: R
    });
    if (!x)
      return console.warn("Failed to snapshot the document");
    rt(lt({
      type: ke.FullSnapshot,
      data: {
        node: x,
        initialOffset: {
          left: window.pageXOffset !== void 0 ? window.pageXOffset : (document == null ? void 0 : document.documentElement.scrollLeft) || ((ne = (pe = document == null ? void 0 : document.body) === null || pe === void 0 ? void 0 : pe.parentElement) === null || ne === void 0 ? void 0 : ne.scrollLeft) || ((ee = document == null ? void 0 : document.body) === null || ee === void 0 ? void 0 : ee.scrollLeft) || 0,
          top: window.pageYOffset !== void 0 ? window.pageYOffset : (document == null ? void 0 : document.documentElement.scrollTop) || ((me = (we = document == null ? void 0 : document.body) === null || we === void 0 ? void 0 : we.parentElement) === null || me === void 0 ? void 0 : me.scrollTop) || ((De = document == null ? void 0 : document.body) === null || De === void 0 ? void 0 : De.scrollTop) || 0
        }
      }
    })), _r.forEach((A) => A.unlock()), document.adoptedStyleSheets && document.adoptedStyleSheets.length > 0 && ie.adoptStyleSheets(document.adoptedStyleSheets, Yt.getId(document));
  };
  try {
    const j = [];
    j.push(Dt("DOMContentLoaded", () => {
      rt(lt({
        type: ke.DomContentLoaded,
        data: {}
      }));
    }));
    const pe = (ee) => {
      var we;
      return yN({
        mutationCb: B,
        mousemoveCb: (me, De) => rt(lt({
          type: ke.IncrementalSnapshot,
          data: {
            source: De,
            positions: me
          }
        })),
        mouseInteractionCb: (me) => rt(lt({
          type: ke.IncrementalSnapshot,
          data: Object.assign({ source: Ae.MouseInteraction }, me)
        })),
        scrollCb: U,
        viewportResizeCb: (me) => rt(lt({
          type: ke.IncrementalSnapshot,
          data: Object.assign({ source: Ae.ViewportResize }, me)
        })),
        inputCb: (me) => rt(lt({
          type: ke.IncrementalSnapshot,
          data: Object.assign({ source: Ae.Input }, me)
        })),
        mediaInteractionCb: (me) => rt(lt({
          type: ke.IncrementalSnapshot,
          data: Object.assign({ source: Ae.MediaInteraction }, me)
        })),
        styleSheetRuleCb: (me) => rt(lt({
          type: ke.IncrementalSnapshot,
          data: Object.assign({ source: Ae.StyleSheetRule }, me)
        })),
        styleDeclarationCb: (me) => rt(lt({
          type: ke.IncrementalSnapshot,
          data: Object.assign({ source: Ae.StyleDeclaration }, me)
        })),
        canvasMutationCb: J,
        fontCb: (me) => rt(lt({
          type: ke.IncrementalSnapshot,
          data: Object.assign({ source: Ae.Font }, me)
        })),
        selectionCb: (me) => {
          rt(lt({
            type: ke.IncrementalSnapshot,
            data: Object.assign({ source: Ae.Selection }, me)
          }));
        },
        blockClass: o,
        ignoreClass: s,
        maskTextClass: a,
        maskTextSelector: l,
        maskInputOptions: D,
        inlineStylesheet: c,
        sampling: v,
        recordCanvas: E,
        inlineImages: _,
        userTriggeredOnInput: T,
        collectFonts: C,
        doc: ee,
        maskInputFn: m,
        maskTextFn: h,
        keepIframeSrcFn: R,
        blockSelector: i,
        slimDOMOptions: P,
        dataURLOptions: y,
        mirror: Yt,
        iframeManager: z,
        stylesheetManager: ie,
        shadowDomManager: le,
        canvasManager: Gl,
        ignoreCSSAttributes: O,
        plugins: ((we = w == null ? void 0 : w.filter((me) => me.observer)) === null || we === void 0 ? void 0 : we.map((me) => ({
          observer: me.observer,
          options: me.options,
          callback: (De) => rt(lt({
            type: ke.Plugin,
            data: {
              plugin: me.name,
              payload: De
            }
          }))
        }))) || []
      }, p);
    };
    z.addLoadListener((ee) => {
      j.push(pe(ee.contentDocument));
    });
    const ne = () => {
      ma(), j.push(pe(document)), ja = !0;
    };
    return document.readyState === "interactive" || document.readyState === "complete" ? ne() : j.push(Dt("load", () => {
      rt(lt({
        type: ke.Load,
        data: {}
      })), ne();
    }, window)), () => {
      j.forEach((ee) => ee()), ja = !1;
    };
  } catch (j) {
    console.warn(j);
  }
}
ws.addCustomEvent = (e, t) => {
  if (!ja)
    throw new Error("please add custom event after start recording");
  rt(lt({
    type: ke.Custom,
    data: {
      tag: e,
      payload: t
    }
  }));
};
ws.freezePage = () => {
  _r.forEach((e) => e.freeze());
};
ws.takeFullSnapshot = (e) => {
  if (!ja)
    throw new Error("please take full snapshot after start recording");
  ma(e);
};
ws.mirror = Yt;
var Hv = { exports: {} };
(function(e, t) {
  (function(n, r) {
    e.exports = r();
  })(C_, function() {
    var n = 1e3, r = 6e4, o = 36e5, i = "millisecond", s = "second", a = "minute", l = "hour", c = "day", u = "week", d = "month", f = "quarter", m = "year", h = "date", p = "Invalid Date", g = /^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/, v = /\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g, y = { name: "en", weekdays: "Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"), months: "January_February_March_April_May_June_July_August_September_October_November_December".split("_"), ordinal: function(D) {
      var P = ["th", "st", "nd", "rd"], k = D % 100;
      return "[" + D + (P[(k - 20) % 10] || P[k] || P[0]) + "]";
    } }, b = function(D, P, k) {
      var N = String(D);
      return !N || N.length >= P ? D : "" + Array(P + 1 - N.length).join(k) + D;
    }, E = { s: b, z: function(D) {
      var P = -D.utcOffset(), k = Math.abs(P), N = Math.floor(k / 60), $ = k % 60;
      return (P <= 0 ? "+" : "-") + b(N, 2, "0") + ":" + b($, 2, "0");
    }, m: function D(P, k) {
      if (P.date() < k.date())
        return -D(k, P);
      var N = 12 * (k.year() - P.year()) + (k.month() - P.month()), $ = P.clone().add(N, d), B = k - $ < 0, U = P.clone().add(N + (B ? -1 : 1), d);
      return +(-(N + (k - $) / (B ? $ - U : U - $)) || 0);
    }, a: function(D) {
      return D < 0 ? Math.ceil(D) || 0 : Math.floor(D);
    }, p: function(D) {
      return { M: d, y: m, w: u, d: c, D: h, h: l, m: a, s, ms: i, Q: f }[D] || String(D || "").toLowerCase().replace(/s$/, "");
    }, u: function(D) {
      return D === void 0;
    } }, S = "en", T = {};
    T[S] = y;
    var C = "$isDayjsObject", _ = function(D) {
      return D instanceof I || !(!D || !D[C]);
    }, w = function D(P, k, N) {
      var $;
      if (!P)
        return S;
      if (typeof P == "string") {
        var B = P.toLowerCase();
        T[B] && ($ = B), k && (T[B] = k, $ = B);
        var U = P.split("-");
        if (!$ && U.length > 1)
          return D(U[0]);
      } else {
        var J = P.name;
        T[J] = P, $ = J;
      }
      return !N && $ && (S = $), $ || !N && S;
    }, R = function(D, P) {
      if (_(D))
        return D.clone();
      var k = typeof P == "object" ? P : {};
      return k.date = D, k.args = arguments, new I(k);
    }, O = E;
    O.l = w, O.i = _, O.w = function(D, P) {
      return R(D, { locale: P.$L, utc: P.$u, x: P.$x, $offset: P.$offset });
    };
    var I = function() {
      function D(k) {
        this.$L = w(k.locale, null, !0), this.parse(k), this.$x = this.$x || k.x || {}, this[C] = !0;
      }
      var P = D.prototype;
      return P.parse = function(k) {
        this.$d = function(N) {
          var $ = N.date, B = N.utc;
          if ($ === null)
            return /* @__PURE__ */ new Date(NaN);
          if (O.u($))
            return /* @__PURE__ */ new Date();
          if ($ instanceof Date)
            return new Date($);
          if (typeof $ == "string" && !/Z$/i.test($)) {
            var U = $.match(g);
            if (U) {
              var J = U[2] - 1 || 0, te = (U[7] || "0").substring(0, 3);
              return B ? new Date(Date.UTC(U[1], J, U[3] || 1, U[4] || 0, U[5] || 0, U[6] || 0, te)) : new Date(U[1], J, U[3] || 1, U[4] || 0, U[5] || 0, U[6] || 0, te);
            }
          }
          return new Date($);
        }(k), this.init();
      }, P.init = function() {
        var k = this.$d;
        this.$y = k.getFullYear(), this.$M = k.getMonth(), this.$D = k.getDate(), this.$W = k.getDay(), this.$H = k.getHours(), this.$m = k.getMinutes(), this.$s = k.getSeconds(), this.$ms = k.getMilliseconds();
      }, P.$utils = function() {
        return O;
      }, P.isValid = function() {
        return this.$d.toString() !== p;
      }, P.isSame = function(k, N) {
        var $ = R(k);
        return this.startOf(N) <= $ && $ <= this.endOf(N);
      }, P.isAfter = function(k, N) {
        return R(k) < this.startOf(N);
      }, P.isBefore = function(k, N) {
        return this.endOf(N) < R(k);
      }, P.$g = function(k, N, $) {
        return O.u(k) ? this[N] : this.set($, k);
      }, P.unix = function() {
        return Math.floor(this.valueOf() / 1e3);
      }, P.valueOf = function() {
        return this.$d.getTime();
      }, P.startOf = function(k, N) {
        var $ = this, B = !!O.u(N) || N, U = O.p(k), J = function(ee, we) {
          var me = O.w($.$u ? Date.UTC($.$y, we, ee) : new Date($.$y, we, ee), $);
          return B ? me : me.endOf(c);
        }, te = function(ee, we) {
          return O.w($.toDate()[ee].apply($.toDate("s"), (B ? [0, 0, 0, 0] : [23, 59, 59, 999]).slice(we)), $);
        }, ie = this.$W, z = this.$M, le = this.$D, j = "set" + (this.$u ? "UTC" : "");
        switch (U) {
          case m:
            return B ? J(1, 0) : J(31, 11);
          case d:
            return B ? J(1, z) : J(0, z + 1);
          case u:
            var pe = this.$locale().weekStart || 0, ne = (ie < pe ? ie + 7 : ie) - pe;
            return J(B ? le - ne : le + (6 - ne), z);
          case c:
          case h:
            return te(j + "Hours", 0);
          case l:
            return te(j + "Minutes", 1);
          case a:
            return te(j + "Seconds", 2);
          case s:
            return te(j + "Milliseconds", 3);
          default:
            return this.clone();
        }
      }, P.endOf = function(k) {
        return this.startOf(k, !1);
      }, P.$set = function(k, N) {
        var $, B = O.p(k), U = "set" + (this.$u ? "UTC" : ""), J = ($ = {}, $[c] = U + "Date", $[h] = U + "Date", $[d] = U + "Month", $[m] = U + "FullYear", $[l] = U + "Hours", $[a] = U + "Minutes", $[s] = U + "Seconds", $[i] = U + "Milliseconds", $)[B], te = B === c ? this.$D + (N - this.$W) : N;
        if (B === d || B === m) {
          var ie = this.clone().set(h, 1);
          ie.$d[J](te), ie.init(), this.$d = ie.set(h, Math.min(this.$D, ie.daysInMonth())).$d;
        } else
          J && this.$d[J](te);
        return this.init(), this;
      }, P.set = function(k, N) {
        return this.clone().$set(k, N);
      }, P.get = function(k) {
        return this[O.p(k)]();
      }, P.add = function(k, N) {
        var $, B = this;
        k = Number(k);
        var U = O.p(N), J = function(z) {
          var le = R(B);
          return O.w(le.date(le.date() + Math.round(z * k)), B);
        };
        if (U === d)
          return this.set(d, this.$M + k);
        if (U === m)
          return this.set(m, this.$y + k);
        if (U === c)
          return J(1);
        if (U === u)
          return J(7);
        var te = ($ = {}, $[a] = r, $[l] = o, $[s] = n, $)[U] || 1, ie = this.$d.getTime() + k * te;
        return O.w(ie, this);
      }, P.subtract = function(k, N) {
        return this.add(-1 * k, N);
      }, P.format = function(k) {
        var N = this, $ = this.$locale();
        if (!this.isValid())
          return $.invalidDate || p;
        var B = k || "YYYY-MM-DDTHH:mm:ssZ", U = O.z(this), J = this.$H, te = this.$m, ie = this.$M, z = $.weekdays, le = $.months, j = $.meridiem, pe = function(we, me, De, x) {
          return we && (we[me] || we(N, B)) || De[me].slice(0, x);
        }, ne = function(we) {
          return O.s(J % 12 || 12, we, "0");
        }, ee = j || function(we, me, De) {
          var x = we < 12 ? "AM" : "PM";
          return De ? x.toLowerCase() : x;
        };
        return B.replace(v, function(we, me) {
          return me || function(De) {
            switch (De) {
              case "YY":
                return String(N.$y).slice(-2);
              case "YYYY":
                return O.s(N.$y, 4, "0");
              case "M":
                return ie + 1;
              case "MM":
                return O.s(ie + 1, 2, "0");
              case "MMM":
                return pe($.monthsShort, ie, le, 3);
              case "MMMM":
                return pe(le, ie);
              case "D":
                return N.$D;
              case "DD":
                return O.s(N.$D, 2, "0");
              case "d":
                return String(N.$W);
              case "dd":
                return pe($.weekdaysMin, N.$W, z, 2);
              case "ddd":
                return pe($.weekdaysShort, N.$W, z, 3);
              case "dddd":
                return z[N.$W];
              case "H":
                return String(J);
              case "HH":
                return O.s(J, 2, "0");
              case "h":
                return ne(1);
              case "hh":
                return ne(2);
              case "a":
                return ee(J, te, !0);
              case "A":
                return ee(J, te, !1);
              case "m":
                return String(te);
              case "mm":
                return O.s(te, 2, "0");
              case "s":
                return String(N.$s);
              case "ss":
                return O.s(N.$s, 2, "0");
              case "SSS":
                return O.s(N.$ms, 3, "0");
              case "Z":
                return U;
            }
            return null;
          }(we) || U.replace(":", "");
        });
      }, P.utcOffset = function() {
        return 15 * -Math.round(this.$d.getTimezoneOffset() / 15);
      }, P.diff = function(k, N, $) {
        var B, U = this, J = O.p(N), te = R(k), ie = (te.utcOffset() - this.utcOffset()) * r, z = this - te, le = function() {
          return O.m(U, te);
        };
        switch (J) {
          case m:
            B = le() / 12;
            break;
          case d:
            B = le();
            break;
          case f:
            B = le() / 3;
            break;
          case u:
            B = (z - ie) / 6048e5;
            break;
          case c:
            B = (z - ie) / 864e5;
            break;
          case l:
            B = z / o;
            break;
          case a:
            B = z / r;
            break;
          case s:
            B = z / n;
            break;
          default:
            B = z;
        }
        return $ ? B : O.a(B);
      }, P.daysInMonth = function() {
        return this.endOf(d).$D;
      }, P.$locale = function() {
        return T[this.$L];
      }, P.locale = function(k, N) {
        if (!k)
          return this.$L;
        var $ = this.clone(), B = w(k, N, !0);
        return B && ($.$L = B), $;
      }, P.clone = function() {
        return O.w(this.$d, this);
      }, P.toDate = function() {
        return new Date(this.valueOf());
      }, P.toJSON = function() {
        return this.isValid() ? this.toISOString() : null;
      }, P.toISOString = function() {
        return this.$d.toISOString();
      }, P.toString = function() {
        return this.$d.toUTCString();
      }, D;
    }(), L = I.prototype;
    return R.prototype = L, [["$ms", i], ["$s", s], ["$m", a], ["$H", l], ["$W", c], ["$M", d], ["$y", m], ["$D", h]].forEach(function(D) {
      L[D[1]] = function(P) {
        return this.$g(P, D[0], D[1]);
      };
    }), R.extend = function(D, P) {
      return D.$i || (D(P, I, R), D.$i = !0), R;
    }, R.locale = w, R.isDayjs = _, R.unix = function(D) {
      return R(1e3 * D);
    }, R.en = T[S], R.Ls = T, R.p = {}, R;
  });
})(Hv);
var VN = Hv.exports;
const Di = /* @__PURE__ */ w_(VN);
let zN = (e) => crypto.getRandomValues(new Uint8Array(e)), jN = (e, t, n) => {
  let r = (2 << Math.log(e.length - 1) / Math.LN2) - 1, o = -~(1.6 * r * t / e.length);
  return (i = t) => {
    let s = "";
    for (; ; ) {
      let a = n(o), l = o;
      for (; l--; )
        if (s += e[a[l] & r] || "", s.length === i)
          return s;
    }
  };
}, Rh = (e, t = 21) => jN(e, t, zN);
const Ph = Array.from(new Array(26), (e, t) => String.fromCharCode(65 + t) + t);
class HN {
  constructor() {
    this.tableName = "pm_monitoring_sdk", this.expiresTime = 10 * 60 * 1e3;
  }
  init() {
    this.db = new Pr(this.tableName), this.db.version(1).stores({ events: "id, content, time" });
  }
  dels() {
    this.db.events.where("id").above(0).toArray().then((t) => {
      const n = [];
      t.forEach((r) => {
        Di().valueOf() - r.time > this.expiresTime && n.push(r.id);
      }), this.db.events.bulkDelete(n);
    });
  }
  add({ event: t }) {
    const n = Rh(Ph.join(""), 20);
    this.db.events.add({
      content: JSON.stringify(t),
      time: Di().valueOf(),
      id: n()
    });
  }
  bulkAdd(t) {
    const n = Rh(Ph.join(""), 20), r = t.map((o) => ({
      ...o,
      id: n()
    }));
    return this.db.events.bulkAdd(r);
  }
  find({ time: t }) {
    return this.db.events.where("time").above(t).toArray();
  }
  getAll({ time: t }) {
    return this.db.events.where("time").above(t).toArray();
  }
  clear() {
    return this.db.events.clear();
  }
}
function os() {
}
function Fh(e, t) {
  for (const n in t)
    e[n] = t[n];
  return e;
}
function Wv(e) {
  return e();
}
function Bh() {
  return /* @__PURE__ */ Object.create(null);
}
function Go(e) {
  e.forEach(Wv);
}
function Uv(e) {
  return typeof e == "function";
}
function dd(e, t) {
  return e != e ? t == t : e !== t || e && typeof e == "object" || typeof e == "function";
}
function Lh(e) {
  const t = {};
  for (const n in e)
    n[0] !== "$" && (t[n] = e[n]);
  return t;
}
function Re(e, t) {
  e.appendChild(t);
}
function $n(e, t, n) {
  e.insertBefore(t, n || null);
}
function hn(e) {
  e.parentNode && e.parentNode.removeChild(e);
}
function Yl(e, t) {
  for (let n = 0; n < e.length; n += 1)
    e[n] && e[n].d(t);
}
function ut(e) {
  return document.createElement(e);
}
function Ha(e) {
  return document.createElementNS("http://www.w3.org/2000/svg", e);
}
function Ur(e) {
  return document.createTextNode(e);
}
function Ht() {
  return Ur(" ");
}
function Mi(e, t, n, r) {
  return e.addEventListener(t, n, r), () => e.removeEventListener(t, n, r);
}
function Ce(e, t, n) {
  n == null ? e.removeAttribute(t) : e.getAttribute(t) !== n && e.setAttribute(t, n);
}
function Wa(e, t) {
  t = "" + t, e.data !== t && (e.data = t);
}
function ot(e, t, n, r) {
  n == null ? e.style.removeProperty(t) : e.style.setProperty(t, n, r ? "important" : "");
}
function Po(e, t, n) {
  e.classList[n ? "add" : "remove"](t);
}
let is;
function $i(e) {
  is = e;
}
function xl() {
  if (!is)
    throw new Error("Function called outside component initialization");
  return is;
}
function Kv(e) {
  xl().$$.on_mount.push(e);
}
function Gv(e) {
  xl().$$.on_destroy.push(e);
}
function WN() {
  const e = xl();
  return (t, n, { cancelable: r = !1 } = {}) => {
    const o = e.$$.callbacks[t];
    if (o) {
      const i = function(s, a, { bubbles: l = !1, cancelable: c = !1 } = {}) {
        const u = document.createEvent("CustomEvent");
        return u.initCustomEvent(s, l, c, a), u;
      }(t, n, { cancelable: r });
      return o.slice().forEach((s) => {
        s.call(e, i);
      }), !i.defaultPrevented;
    }
    return !0;
  };
}
const co = [], Xn = [];
let To = [];
const cu = [], UN = Promise.resolve();
let uu = !1;
function du(e) {
  To.push(e);
}
const ql = /* @__PURE__ */ new Set();
let io = 0;
function Yv() {
  if (io !== 0)
    return;
  const e = is;
  do {
    try {
      for (; io < co.length; ) {
        const t = co[io];
        io++, $i(t), KN(t.$$);
      }
    } catch (t) {
      throw co.length = 0, io = 0, t;
    }
    for ($i(null), co.length = 0, io = 0; Xn.length; )
      Xn.pop()();
    for (let t = 0; t < To.length; t += 1) {
      const n = To[t];
      ql.has(n) || (ql.add(n), n());
    }
    To.length = 0;
  } while (co.length);
  for (; cu.length; )
    cu.pop()();
  uu = !1, ql.clear(), $i(e);
}
function KN(e) {
  if (e.fragment !== null) {
    e.update(), Go(e.before_update);
    const t = e.dirty;
    e.dirty = [-1], e.fragment && e.fragment.p(e.ctx, t), e.after_update.forEach(du);
  }
}
const ga = /* @__PURE__ */ new Set();
let Ir;
function qv() {
  Ir = { r: 0, c: [], p: Ir };
}
function Zv() {
  Ir.r || Go(Ir.c), Ir = Ir.p;
}
function Tn(e, t) {
  e && e.i && (ga.delete(e), e.i(t));
}
function Fo(e, t, n, r) {
  if (e && e.o) {
    if (ga.has(e))
      return;
    ga.add(e), Ir.c.push(() => {
      ga.delete(e), r && (n && e.d(1), r());
    }), e.o(t);
  } else
    r && r();
}
function Xv(e) {
  e && e.c();
}
function fd(e, t, n, r) {
  const { fragment: o, after_update: i } = e.$$;
  o && o.m(t, n), r || du(() => {
    const s = e.$$.on_mount.map(Wv).filter(Uv);
    e.$$.on_destroy ? e.$$.on_destroy.push(...s) : Go(s), e.$$.on_mount = [];
  }), i.forEach(du);
}
function hd(e, t) {
  const n = e.$$;
  n.fragment !== null && (function(r) {
    const o = [], i = [];
    To.forEach((s) => r.indexOf(s) === -1 ? o.push(s) : i.push(s)), i.forEach((s) => s()), To = o;
  }(n.after_update), Go(n.on_destroy), n.fragment && n.fragment.d(t), n.on_destroy = n.fragment = null, n.ctx = []);
}
function GN(e, t) {
  e.$$.dirty[0] === -1 && (co.push(e), uu || (uu = !0, UN.then(Yv)), e.$$.dirty.fill(0)), e.$$.dirty[t / 31 | 0] |= 1 << t % 31;
}
function pd(e, t, n, r, o, i, s, a = [-1]) {
  const l = is;
  $i(e);
  const c = e.$$ = { fragment: null, ctx: [], props: i, update: os, not_equal: o, bound: Bh(), on_mount: [], on_destroy: [], on_disconnect: [], before_update: [], after_update: [], context: new Map(t.context || (l ? l.$$.context : [])), callbacks: Bh(), dirty: a, skip_bound: !1, root: t.target || l.$$.root };
  s && s(c.root);
  let u = !1;
  if (c.ctx = n ? n(e, t.props || {}, (d, f, ...m) => {
    const h = m.length ? m[0] : f;
    return c.ctx && o(c.ctx[d], c.ctx[d] = h) && (!c.skip_bound && c.bound[d] && c.bound[d](h), u && GN(e, d)), f;
  }) : [], c.update(), u = !0, Go(c.before_update), c.fragment = !!r && r(c.ctx), t.target) {
    if (t.hydrate) {
      const d = function(f) {
        return Array.from(f.childNodes);
      }(t.target);
      c.fragment && c.fragment.l(d), d.forEach(hn);
    } else
      c.fragment && c.fragment.c();
    t.intro && Tn(e.$$.fragment), fd(e, t.target, t.anchor, t.customElement), Yv();
  }
  $i(l);
}
class md {
  $destroy() {
    hd(this, 1), this.$destroy = os;
  }
  $on(t, n) {
    if (!Uv(n))
      return os;
    const r = this.$$.callbacks[t] || (this.$$.callbacks[t] = []);
    return r.push(n), () => {
      const o = r.indexOf(n);
      o !== -1 && r.splice(o, 1);
    };
  }
  $set(t) {
    var n;
    this.$$set && (n = t, Object.keys(n).length !== 0) && (this.$$.skip_bound = !0, this.$$set(t), this.$$.skip_bound = !1);
  }
}
var Le;
(function(e) {
  e[e.Document = 0] = "Document", e[e.DocumentType = 1] = "DocumentType", e[e.Element = 2] = "Element", e[e.Text = 3] = "Text", e[e.CDATA = 4] = "CDATA", e[e.Comment = 5] = "Comment";
})(Le || (Le = {}));
var Jv = function() {
  function e() {
    this.idNodeMap = /* @__PURE__ */ new Map(), this.nodeMetaMap = /* @__PURE__ */ new WeakMap();
  }
  return e.prototype.getId = function(t) {
    var n;
    if (!t)
      return -1;
    var r = (n = this.getMeta(t)) === null || n === void 0 ? void 0 : n.id;
    return r ?? -1;
  }, e.prototype.getNode = function(t) {
    return this.idNodeMap.get(t) || null;
  }, e.prototype.getIds = function() {
    return Array.from(this.idNodeMap.keys());
  }, e.prototype.getMeta = function(t) {
    return this.nodeMetaMap.get(t) || null;
  }, e.prototype.removeNodeFromMap = function(t) {
    var n = this, r = this.getId(t);
    this.idNodeMap.delete(r), t.childNodes && t.childNodes.forEach(function(o) {
      return n.removeNodeFromMap(o);
    });
  }, e.prototype.has = function(t) {
    return this.idNodeMap.has(t);
  }, e.prototype.hasNode = function(t) {
    return this.nodeMetaMap.has(t);
  }, e.prototype.add = function(t, n) {
    var r = n.id;
    this.idNodeMap.set(r, t), this.nodeMetaMap.set(t, n);
  }, e.prototype.replace = function(t, n) {
    var r = this.getNode(t);
    if (r) {
      var o = this.nodeMetaMap.get(r);
      o && this.nodeMetaMap.set(n, o);
    }
    this.idNodeMap.set(t, n);
  }, e.prototype.reset = function() {
    this.idNodeMap = /* @__PURE__ */ new Map(), this.nodeMetaMap = /* @__PURE__ */ new WeakMap();
  }, e;
}();
function YN() {
  return new Jv();
}
var Vh = /\/\*[^*]*\*+([^/*][^*]*\*+)*\//g;
function qN(e, t) {
  t === void 0 && (t = {});
  var n = 1, r = 1;
  function o(O) {
    var I = O.match(/\n/g);
    I && (n += I.length);
    var L = O.lastIndexOf(`
`);
    r = L === -1 ? r + O.length : O.length - L;
  }
  function i() {
    var O = { line: n, column: r };
    return function(I) {
      return I.position = new s(O), m(), I;
    };
  }
  var s = function(O) {
    this.start = O, this.end = { line: n, column: r }, this.source = t.source;
  };
  s.prototype.content = e;
  var a = [];
  function l(O) {
    var I = new Error("".concat(t.source || "", ":").concat(n, ":").concat(r, ": ").concat(O));
    if (I.reason = O, I.filename = t.source, I.line = n, I.column = r, I.source = e, !t.silent)
      throw I;
    a.push(I);
  }
  function c() {
    return f(/^{\s*/);
  }
  function u() {
    return f(/^}/);
  }
  function d() {
    var O, I = [];
    for (m(), h(I); e.length && e.charAt(0) !== "}" && (O = w() || R()); )
      O && (I.push(O), h(I));
    return I;
  }
  function f(O) {
    var I = O.exec(e);
    if (I) {
      var L = I[0];
      return o(L), e = e.slice(L.length), I;
    }
  }
  function m() {
    f(/^\s*/);
  }
  function h(O) {
    var I;
    for (O === void 0 && (O = []); I = p(); )
      I && O.push(I), I = p();
    return O;
  }
  function p() {
    var O = i();
    if (e.charAt(0) === "/" && e.charAt(1) === "*") {
      for (var I = 2; e.charAt(I) !== "" && (e.charAt(I) !== "*" || e.charAt(I + 1) !== "/"); )
        ++I;
      if (I += 2, e.charAt(I - 1) === "")
        return l("End of comment missing");
      var L = e.slice(2, I - 2);
      return r += 2, o(L), e = e.slice(I), r += 2, O({ type: "comment", comment: L });
    }
  }
  function g() {
    var O = f(/^([^{]+)/);
    if (O)
      return vn(O[0]).replace(/\/\*([^*]|[\r\n]|(\*+([^*/]|[\r\n])))*\*\/+/g, "").replace(/"(?:\\"|[^"])*"|'(?:\\'|[^'])*'/g, function(I) {
        return I.replace(/,/g, "‌");
      }).split(/\s*(?![^(]*\)),\s*/).map(function(I) {
        return I.replace(/\u200C/g, ",");
      });
  }
  function v() {
    var O = i(), I = f(/^(\*?[-#\/\*\\\w]+(\[[0-9a-z_-]+\])?)\s*/);
    if (I) {
      var L = vn(I[0]);
      if (!f(/^:\s*/))
        return l("property missing ':'");
      var D = f(/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^\)]*?\)|[^};])+)/), P = O({ type: "declaration", property: L.replace(Vh, ""), value: D ? vn(D[0]).replace(Vh, "") : "" });
      return f(/^[;\s]*/), P;
    }
  }
  function y() {
    var O, I = [];
    if (!c())
      return l("missing '{'");
    for (h(I); O = v(); )
      O !== !1 && (I.push(O), h(I)), O = v();
    return u() ? I : l("missing '}'");
  }
  function b() {
    for (var O, I = [], L = i(); O = f(/^((\d+\.\d+|\.\d+|\d+)%?|[a-z]+)\s*/); )
      I.push(O[1]), f(/^,\s*/);
    if (I.length)
      return L({ type: "keyframe", values: I, declarations: y() });
  }
  var E, S = _("import"), T = _("charset"), C = _("namespace");
  function _(O) {
    var I = new RegExp("^@" + O + "\\s*([^;]+);");
    return function() {
      var L = i(), D = f(I);
      if (D) {
        var P = { type: O };
        return P[O] = D[1].trim(), L(P);
      }
    };
  }
  function w() {
    if (e[0] === "@")
      return function() {
        var O = i(), I = f(/^@([-\w]+)?keyframes\s*/);
        if (I) {
          var L = I[1];
          if (!(I = f(/^([-\w]+)\s*/)))
            return l("@keyframes missing name");
          var D, P = I[1];
          if (!c())
            return l("@keyframes missing '{'");
          for (var k = h(); D = b(); )
            k.push(D), k = k.concat(h());
          return u() ? O({ type: "keyframes", name: P, vendor: L, keyframes: k }) : l("@keyframes missing '}'");
        }
      }() || function() {
        var O = i(), I = f(/^@media *([^{]+)/);
        if (I) {
          var L = vn(I[1]);
          if (!c())
            return l("@media missing '{'");
          var D = h().concat(d());
          return u() ? O({ type: "media", media: L, rules: D }) : l("@media missing '}'");
        }
      }() || function() {
        var O = i(), I = f(/^@custom-media\s+(--[^\s]+)\s*([^{;]+);/);
        if (I)
          return O({ type: "custom-media", name: vn(I[1]), media: vn(I[2]) });
      }() || function() {
        var O = i(), I = f(/^@supports *([^{]+)/);
        if (I) {
          var L = vn(I[1]);
          if (!c())
            return l("@supports missing '{'");
          var D = h().concat(d());
          return u() ? O({ type: "supports", supports: L, rules: D }) : l("@supports missing '}'");
        }
      }() || S() || T() || C() || function() {
        var O = i(), I = f(/^@([-\w]+)?document *([^{]+)/);
        if (I) {
          var L = vn(I[1]), D = vn(I[2]);
          if (!c())
            return l("@document missing '{'");
          var P = h().concat(d());
          return u() ? O({ type: "document", document: D, vendor: L, rules: P }) : l("@document missing '}'");
        }
      }() || function() {
        var O = i();
        if (f(/^@page */)) {
          var I = g() || [];
          if (!c())
            return l("@page missing '{'");
          for (var L, D = h(); L = v(); )
            D.push(L), D = D.concat(h());
          return u() ? O({ type: "page", selectors: I, declarations: D }) : l("@page missing '}'");
        }
      }() || function() {
        var O = i();
        if (f(/^@host\s*/)) {
          if (!c())
            return l("@host missing '{'");
          var I = h().concat(d());
          return u() ? O({ type: "host", rules: I }) : l("@host missing '}'");
        }
      }() || function() {
        var O = i();
        if (f(/^@font-face\s*/)) {
          if (!c())
            return l("@font-face missing '{'");
          for (var I, L = h(); I = v(); )
            L.push(I), L = L.concat(h());
          return u() ? O({ type: "font-face", declarations: L }) : l("@font-face missing '}'");
        }
      }();
  }
  function R() {
    var O = i(), I = g();
    return I ? (h(), O({ type: "rule", selectors: I, declarations: y() })) : l("selector missing");
  }
  return fu((E = d(), { type: "stylesheet", stylesheet: { source: t.source, rules: E, parsingErrors: a } }));
}
function vn(e) {
  return e ? e.replace(/^\s+|\s+$/g, "") : "";
}
function fu(e, t) {
  for (var n = e && typeof e.type == "string", r = n ? e : t, o = 0, i = Object.keys(e); o < i.length; o++) {
    var s = e[i[o]];
    Array.isArray(s) ? s.forEach(function(a) {
      fu(a, r);
    }) : s && typeof s == "object" && fu(s, r);
  }
  return n && Object.defineProperty(e, "parent", { configurable: !0, writable: !0, enumerable: !1, value: t || null }), e;
}
var zh = { script: "noscript", altglyph: "altGlyph", altglyphdef: "altGlyphDef", altglyphitem: "altGlyphItem", animatecolor: "animateColor", animatemotion: "animateMotion", animatetransform: "animateTransform", clippath: "clipPath", feblend: "feBlend", fecolormatrix: "feColorMatrix", fecomponenttransfer: "feComponentTransfer", fecomposite: "feComposite", feconvolvematrix: "feConvolveMatrix", fediffuselighting: "feDiffuseLighting", fedisplacementmap: "feDisplacementMap", fedistantlight: "feDistantLight", fedropshadow: "feDropShadow", feflood: "feFlood", fefunca: "feFuncA", fefuncb: "feFuncB", fefuncg: "feFuncG", fefuncr: "feFuncR", fegaussianblur: "feGaussianBlur", feimage: "feImage", femerge: "feMerge", femergenode: "feMergeNode", femorphology: "feMorphology", feoffset: "feOffset", fepointlight: "fePointLight", fespecularlighting: "feSpecularLighting", fespotlight: "feSpotLight", fetile: "feTile", feturbulence: "feTurbulence", foreignobject: "foreignObject", glyphref: "glyphRef", lineargradient: "linearGradient", radialgradient: "radialGradient" }, Qv = /([^\\]):hover/, ZN = new RegExp(Qv.source, "g");
function jh(e, t) {
  var n = t == null ? void 0 : t.stylesWithHoverClass.get(e);
  if (n)
    return n;
  var r = qN(e, { silent: !0 });
  if (!r.stylesheet)
    return e;
  var o = [];
  if (r.stylesheet.rules.forEach(function(a) {
    "selectors" in a && (a.selectors || []).forEach(function(l) {
      Qv.test(l) && o.push(l);
    });
  }), o.length === 0)
    return e;
  var i = new RegExp(o.filter(function(a, l) {
    return o.indexOf(a) === l;
  }).sort(function(a, l) {
    return l.length - a.length;
  }).map(function(a) {
    return a.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
  }).join("|"), "g"), s = e.replace(i, function(a) {
    var l = a.replace(ZN, "$1.\\:hover");
    return "".concat(a, ", ").concat(l);
  });
  return t == null || t.stylesWithHoverClass.set(e, s), s;
}
function Hh() {
  return { stylesWithHoverClass: /* @__PURE__ */ new Map() };
}
function XN(e, t) {
  var n = t.doc, r = t.hackCss, o = t.cache;
  switch (e.type) {
    case Le.Document:
      return n.implementation.createDocument(null, "", null);
    case Le.DocumentType:
      return n.implementation.createDocumentType(e.name || "html", e.publicId, e.systemId);
    case Le.Element:
      var i, s = function(y) {
        var b = zh[y.tagName] ? zh[y.tagName] : y.tagName;
        return b === "link" && y.attributes._cssText && (b = "style"), b;
      }(e);
      i = e.isSVG ? n.createElementNS("http://www.w3.org/2000/svg", s) : n.createElement(s);
      var a = {};
      for (var l in e.attributes)
        if (Object.prototype.hasOwnProperty.call(e.attributes, l)) {
          var c = e.attributes[l];
          if ((s !== "option" || l !== "selected" || c !== !1) && c !== null)
            if (c === !0 && (c = ""), l.startsWith("rr_"))
              a[l] = c;
            else {
              var u = s === "textarea" && l === "value", d = s === "style" && l === "_cssText";
              if (d && r && typeof c == "string" && (c = jh(c, o)), !u && !d || typeof c != "string")
                try {
                  if (e.isSVG && l === "xlink:href")
                    i.setAttributeNS("http://www.w3.org/1999/xlink", l, c.toString());
                  else if (l === "onload" || l === "onclick" || l.substring(0, 7) === "onmouse")
                    i.setAttribute("_" + l, c.toString());
                  else {
                    if (s === "meta" && e.attributes["http-equiv"] === "Content-Security-Policy" && l === "content") {
                      i.setAttribute("csp-content", c.toString());
                      continue;
                    }
                    (s !== "link" || e.attributes.rel !== "preload" && e.attributes.rel !== "modulepreload" || e.attributes.as !== "script") && (s === "link" && e.attributes.rel === "prefetch" && typeof e.attributes.href == "string" && e.attributes.href.endsWith(".js") || (s === "img" && e.attributes.srcset && e.attributes.rr_dataURL ? i.setAttribute("rrweb-original-srcset", e.attributes.srcset) : i.setAttribute(l, c.toString())));
                  }
                } catch {
                }
              else {
                for (var f = n.createTextNode(c), m = 0, h = Array.from(i.childNodes); m < h.length; m++) {
                  var p = h[m];
                  p.nodeType === i.TEXT_NODE && i.removeChild(p);
                }
                i.appendChild(f);
              }
            }
        }
      var g = function(y) {
        var b = a[y];
        if (s === "canvas" && y === "rr_dataURL") {
          var E = document.createElement("img");
          E.onload = function() {
            var T = i.getContext("2d");
            T && T.drawImage(E, 0, 0, E.width, E.height);
          }, E.src = b.toString(), i.RRNodeType && (i.rr_dataURL = b.toString());
        } else if (s === "img" && y === "rr_dataURL") {
          var S = i;
          S.currentSrc.startsWith("data:") || (S.setAttribute("rrweb-original-src", e.attributes.src), S.src = b.toString());
        }
        if (y === "rr_width")
          i.style.width = b.toString();
        else if (y === "rr_height")
          i.style.height = b.toString();
        else if (y === "rr_mediaCurrentTime" && typeof b == "number")
          i.currentTime = b;
        else if (y === "rr_mediaState")
          switch (b) {
            case "played":
              i.play().catch(function(T) {
                return console.warn("media playback error", T);
              });
              break;
            case "paused":
              i.pause();
          }
      };
      for (var v in a)
        g(v);
      if (e.isShadowHost)
        if (i.shadowRoot)
          for (; i.shadowRoot.firstChild; )
            i.shadowRoot.removeChild(i.shadowRoot.firstChild);
        else
          i.attachShadow({ mode: "open" });
      return i;
    case Le.Text:
      return n.createTextNode(e.isStyle && r ? jh(e.textContent, o) : e.textContent);
    case Le.CDATA:
      return n.createCDATASection(e.textContent);
    case Le.Comment:
      return n.createComment(e.textContent);
    default:
      return null;
  }
}
function ki(e, t) {
  var n = t.doc, r = t.mirror, o = t.skipChild, i = o !== void 0 && o, s = t.hackCss, a = s === void 0 || s, l = t.afterAppend, c = t.cache;
  if (r.has(e.id)) {
    var u = r.getNode(e.id);
    if (function(p, g) {
      return !(!p || !g || p.type !== g.type) && (p.type === Le.Document ? p.compatMode === g.compatMode : p.type === Le.DocumentType ? p.name === g.name && p.publicId === g.publicId && p.systemId === g.systemId : p.type === Le.Comment || p.type === Le.Text || p.type === Le.CDATA ? p.textContent === g.textContent : p.type === Le.Element && p.tagName === g.tagName && JSON.stringify(p.attributes) === JSON.stringify(g.attributes) && p.isSVG === g.isSVG && p.needBlock === g.needBlock);
    }(r.getMeta(u), e))
      return r.getNode(e.id);
  }
  var d = XN(e, { doc: n, hackCss: a, cache: c });
  if (!d)
    return null;
  if (e.rootId && r.getNode(e.rootId) !== n && r.replace(e.rootId, n), e.type === Le.Document && (n.close(), n.open(), e.compatMode === "BackCompat" && e.childNodes && e.childNodes[0].type !== Le.DocumentType && (e.childNodes[0].type === Le.Element && "xmlns" in e.childNodes[0].attributes && e.childNodes[0].attributes.xmlns === "http://www.w3.org/1999/xhtml" ? n.write('<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "">') : n.write('<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" "">')), d = n), r.add(d, e), (e.type === Le.Document || e.type === Le.Element) && !i)
    for (var f = function(p) {
      var g = ki(p, { doc: n, mirror: r, skipChild: !1, hackCss: a, afterAppend: l, cache: c });
      if (!g)
        return console.warn("Failed to rebuild", p), "continue";
      if (p.isShadow && function(b) {
        return b.nodeType === b.ELEMENT_NODE;
      }(d) && d.shadowRoot)
        d.shadowRoot.appendChild(g);
      else if (e.type === Le.Document && p.type == Le.Element) {
        var v = g, y = null;
        v.childNodes.forEach(function(b) {
          b.nodeName === "BODY" && (y = b);
        }), y ? (v.removeChild(y), d.appendChild(g), v.appendChild(y)) : d.appendChild(g);
      } else
        d.appendChild(g);
      l && l(g, p.id);
    }, m = 0, h = e.childNodes; m < h.length; m++)
      f(h[m]);
  return d;
}
function JN(e, t) {
  var n = t.doc, r = t.onVisit, o = t.hackCss, i = o === void 0 || o, s = t.afterAppend, a = t.cache, l = t.mirror, c = l === void 0 ? new Jv() : l, u = ki(e, { doc: n, mirror: c, skipChild: !1, hackCss: i, afterAppend: s, cache: a });
  return function(d, f) {
    for (var m = 0, h = d.getIds(); m < h.length; m++) {
      var p = h[m];
      d.has(p) && f(d.getNode(p));
    }
  }(c, function(d) {
    r && r(d), function(f, m) {
      var h = m.getMeta(f);
      if ((h == null ? void 0 : h.type) === Le.Element) {
        var p = f;
        for (var g in h.attributes)
          if (Object.prototype.hasOwnProperty.call(h.attributes, g) && g.startsWith("rr_")) {
            var v = h.attributes[g];
            g === "rr_scrollLeft" && (p.scrollLeft = v), g === "rr_scrollTop" && (p.scrollTop = v);
          }
      }
    }(d, c);
  }), u;
}
const uo = `Please stop import mirror directly. Instead of that,\r
now you can use replayer.getMirror() to access the mirror instance of a replayer,\r
or you can use record.mirror to access the mirror instance during recording.`;
let Wh = { map: {}, getId: () => (console.error(uo), -1), getNode: () => (console.error(uo), null), removeNodeFromMap() {
  console.error(uo);
}, has: () => (console.error(uo), !1), reset() {
  console.error(uo);
} };
function QN(e) {
  const t = {}, n = (o, i) => {
    const s = { value: o, parent: i, children: [] };
    return t[o.node.id] = s, s;
  }, r = [];
  for (const o of e) {
    const { nextId: i, parentId: s } = o;
    if (i && i in t) {
      const a = t[i];
      if (a.parent) {
        const l = a.parent.children.indexOf(a);
        a.parent.children.splice(l, 0, n(o, a.parent));
      } else {
        const l = r.indexOf(a);
        r.splice(l, 0, n(o, null));
      }
    } else if (s in t) {
      const a = t[s];
      a.children.push(n(o, a));
    } else
      r.push(n(o, null));
  }
  return r;
}
function ey(e, t) {
  t(e.value);
  for (let n = e.children.length - 1; n >= 0; n--)
    ey(e.children[n], t);
}
function Zl(e, t) {
  return !!(e.nodeName === "IFRAME" && t.getMeta(e));
}
function ty(e, t) {
  var n, r;
  const o = (r = (n = e.ownerDocument) === null || n === void 0 ? void 0 : n.defaultView) === null || r === void 0 ? void 0 : r.frameElement;
  if (!o || o === t)
    return { x: 0, y: 0, relativeScale: 1, absoluteScale: 1 };
  const i = o.getBoundingClientRect(), s = ty(o, t), a = i.height / o.clientHeight;
  return { x: i.x * s.relativeScale + s.x, y: i.y * s.relativeScale + s.y, relativeScale: a, absoluteScale: s.absoluteScale * a };
}
function Xs(e) {
  return !!(e != null && e.shadowRoot);
}
function mi(e, t) {
  const n = e[t[0]];
  return t.length === 1 ? n : mi(n.cssRules[t[1]].cssRules, t.slice(2));
}
function Uh(e) {
  const t = [...e], n = t.pop();
  return { positions: t, index: n };
}
typeof window < "u" && window.Proxy && window.Reflect && (Wh = new Proxy(Wh, { get: (e, t, n) => (t === "map" && console.error(uo), Reflect.get(e, t, n)) })), /[1-9][0-9]{12}/.test(Date.now().toString());
class eT {
  constructor() {
    this.id = 1, this.styleIDMap = /* @__PURE__ */ new WeakMap(), this.idStyleMap = /* @__PURE__ */ new Map();
  }
  getId(t) {
    var n;
    return (n = this.styleIDMap.get(t)) !== null && n !== void 0 ? n : -1;
  }
  has(t) {
    return this.styleIDMap.has(t);
  }
  add(t, n) {
    if (this.has(t))
      return this.getId(t);
    let r;
    return r = n === void 0 ? this.id++ : n, this.styleIDMap.set(t, r), this.idStyleMap.set(r, t), r;
  }
  getStyle(t) {
    return this.idStyleMap.get(t) || null;
  }
  reset() {
    this.styleIDMap = /* @__PURE__ */ new WeakMap(), this.idStyleMap = /* @__PURE__ */ new Map(), this.id = 1;
  }
  generateId() {
    return this.id++;
  }
}
var Ue = ((e) => (e[e.DomContentLoaded = 0] = "DomContentLoaded", e[e.Load = 1] = "Load", e[e.FullSnapshot = 2] = "FullSnapshot", e[e.IncrementalSnapshot = 3] = "IncrementalSnapshot", e[e.Meta = 4] = "Meta", e[e.Custom = 5] = "Custom", e[e.Plugin = 6] = "Plugin", e))(Ue || {}), $e = ((e) => (e[e.Mutation = 0] = "Mutation", e[e.MouseMove = 1] = "MouseMove", e[e.MouseInteraction = 2] = "MouseInteraction", e[e.Scroll = 3] = "Scroll", e[e.ViewportResize = 4] = "ViewportResize", e[e.Input = 5] = "Input", e[e.TouchMove = 6] = "TouchMove", e[e.MediaInteraction = 7] = "MediaInteraction", e[e.StyleSheetRule = 8] = "StyleSheetRule", e[e.CanvasMutation = 9] = "CanvasMutation", e[e.Font = 10] = "Font", e[e.Log = 11] = "Log", e[e.Drag = 12] = "Drag", e[e.StyleDeclaration = 13] = "StyleDeclaration", e[e.Selection = 14] = "Selection", e[e.AdoptedStyleSheet = 15] = "AdoptedStyleSheet", e))($e || {}), ct = ((e) => (e[e.MouseUp = 0] = "MouseUp", e[e.MouseDown = 1] = "MouseDown", e[e.Click = 2] = "Click", e[e.ContextMenu = 3] = "ContextMenu", e[e.DblClick = 4] = "DblClick", e[e.Focus = 5] = "Focus", e[e.Blur = 6] = "Blur", e[e.TouchStart = 7] = "TouchStart", e[e.TouchMove_Departed = 8] = "TouchMove_Departed", e[e.TouchEnd = 9] = "TouchEnd", e[e.TouchCancel = 10] = "TouchCancel", e))(ct || {}), Ua = ((e) => (e[e["2D"] = 0] = "2D", e[e.WebGL = 1] = "WebGL", e[e.WebGL2 = 2] = "WebGL2", e))(Ua || {}), Be = ((e) => (e.Start = "start", e.Pause = "pause", e.Resume = "resume", e.Resize = "resize", e.Finish = "finish", e.FullsnapshotRebuilded = "fullsnapshot-rebuilded", e.LoadStylesheetStart = "load-stylesheet-start", e.LoadStylesheetEnd = "load-stylesheet-end", e.SkipStart = "skip-start", e.SkipEnd = "skip-end", e.MouseInteraction = "mouse-interaction", e.EventCast = "event-cast", e.CustomEvent = "custom-event", e.Flush = "flush", e.StateChange = "state-change", e.PlayBack = "play-back", e.Destroy = "destroy", e))(Be || {});
/*! *****************************************************************************
Copyright (c) Microsoft Corporation.

Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted.

THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
PERFORMANCE OF THIS SOFTWARE.
***************************************************************************** */
function Jn(e, t, n, r) {
  return new (n || (n = Promise))(function(o, i) {
    function s(c) {
      try {
        l(r.next(c));
      } catch (u) {
        i(u);
      }
    }
    function a(c) {
      try {
        l(r.throw(c));
      } catch (u) {
        i(u);
      }
    }
    function l(c) {
      var u;
      c.done ? o(c.value) : (u = c.value, u instanceof n ? u : new n(function(d) {
        d(u);
      })).then(s, a);
    }
    l((r = r.apply(e, t || [])).next());
  });
}
for (var Kh = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/", gi = typeof Uint8Array > "u" ? [] : new Uint8Array(256), Js = 0; Js < Kh.length; Js++)
  gi[Kh.charCodeAt(Js)] = Js;
var Oe;
(function(e) {
  e[e.Document = 0] = "Document", e[e.DocumentType = 1] = "DocumentType", e[e.Element = 2] = "Element", e[e.Text = 3] = "Text", e[e.CDATA = 4] = "CDATA", e[e.Comment = 5] = "Comment";
})(Oe || (Oe = {}));
var tT = function() {
  function e() {
    this.idNodeMap = /* @__PURE__ */ new Map(), this.nodeMetaMap = /* @__PURE__ */ new WeakMap();
  }
  return e.prototype.getId = function(t) {
    var n;
    if (!t)
      return -1;
    var r = (n = this.getMeta(t)) === null || n === void 0 ? void 0 : n.id;
    return r ?? -1;
  }, e.prototype.getNode = function(t) {
    return this.idNodeMap.get(t) || null;
  }, e.prototype.getIds = function() {
    return Array.from(this.idNodeMap.keys());
  }, e.prototype.getMeta = function(t) {
    return this.nodeMetaMap.get(t) || null;
  }, e.prototype.removeNodeFromMap = function(t) {
    var n = this, r = this.getId(t);
    this.idNodeMap.delete(r), t.childNodes && t.childNodes.forEach(function(o) {
      return n.removeNodeFromMap(o);
    });
  }, e.prototype.has = function(t) {
    return this.idNodeMap.has(t);
  }, e.prototype.hasNode = function(t) {
    return this.nodeMetaMap.has(t);
  }, e.prototype.add = function(t, n) {
    var r = n.id;
    this.idNodeMap.set(r, t), this.nodeMetaMap.set(t, n);
  }, e.prototype.replace = function(t, n) {
    var r = this.getNode(t);
    if (r) {
      var o = this.nodeMetaMap.get(r);
      o && this.nodeMetaMap.set(n, o);
    }
    this.idNodeMap.set(t, n);
  }, e.prototype.reset = function() {
    this.idNodeMap = /* @__PURE__ */ new Map(), this.nodeMetaMap = /* @__PURE__ */ new WeakMap();
  }, e;
}();
function Gh(e) {
  const t = [];
  for (const n in e) {
    const r = e[n];
    if (typeof r != "string")
      continue;
    const o = iT(n);
    t.push(`${o}: ${r};`);
  }
  return t.join(" ");
}
const nT = /-([a-z])/g, rT = /^--[a-zA-Z0-9-]+$/, Xl = (e) => rT.test(e) ? e : e.replace(nT, (t, n) => n ? n.toUpperCase() : ""), oT = /\B([A-Z])/g, iT = (e) => e.replace(oT, "-$1").toLowerCase();
class Lt {
  constructor(...t) {
    this.parentElement = null, this.parentNode = null, this.firstChild = null, this.lastChild = null, this.previousSibling = null, this.nextSibling = null, this.ELEMENT_NODE = Qe.ELEMENT_NODE, this.TEXT_NODE = Qe.TEXT_NODE;
  }
  get childNodes() {
    const t = [];
    let n = this.firstChild;
    for (; n; )
      t.push(n), n = n.nextSibling;
    return t;
  }
  contains(t) {
    if (!(t instanceof Lt) || t.ownerDocument !== this.ownerDocument)
      return !1;
    if (t === this)
      return !0;
    for (; t.parentNode; ) {
      if (t.parentNode === this)
        return !0;
      t = t.parentNode;
    }
    return !1;
  }
  appendChild(t) {
    throw new Error("RRDomException: Failed to execute 'appendChild' on 'RRNode': This RRNode type does not support this method.");
  }
  insertBefore(t, n) {
    throw new Error("RRDomException: Failed to execute 'insertBefore' on 'RRNode': This RRNode type does not support this method.");
  }
  removeChild(t) {
    throw new Error("RRDomException: Failed to execute 'removeChild' on 'RRNode': This RRNode type does not support this method.");
  }
  toString() {
    return "RRNode";
  }
}
function ny(e) {
  return class extends e {
    constructor(t, n, r) {
      super(), this.nodeType = Qe.DOCUMENT_TYPE_NODE, this.RRNodeType = Oe.DocumentType, this.name = t, this.publicId = n, this.systemId = r, this.nodeName = t, this.textContent = null;
    }
    toString() {
      return "RRDocumentType";
    }
  };
}
function ry(e) {
  return class extends e {
    constructor(t) {
      super(), this.nodeType = Qe.ELEMENT_NODE, this.RRNodeType = Oe.Element, this.attributes = {}, this.shadowRoot = null, this.tagName = t.toUpperCase(), this.nodeName = t.toUpperCase();
    }
    get textContent() {
      let t = "";
      return this.childNodes.forEach((n) => t += n.textContent), t;
    }
    set textContent(t) {
      this.firstChild = null, this.lastChild = null, this.appendChild(this.ownerDocument.createTextNode(t));
    }
    get classList() {
      return new sT(this.attributes.class, (t) => {
        this.attributes.class = t;
      });
    }
    get id() {
      return this.attributes.id || "";
    }
    get className() {
      return this.attributes.class || "";
    }
    get style() {
      const t = this.attributes.style ? function(r) {
        const o = {}, i = /:(.+)/;
        return r.replace(/\/\*.*?\*\//g, "").split(/;(?![^(]*\))/g).forEach(function(s) {
          if (s) {
            const a = s.split(i);
            a.length > 1 && (o[Xl(a[0].trim())] = a[1].trim());
          }
        }), o;
      }(this.attributes.style) : {}, n = /\B([A-Z])/g;
      return t.setProperty = (r, o, i) => {
        if (n.test(r))
          return;
        const s = Xl(r);
        o ? t[s] = o : delete t[s], i === "important" && (t[s] += " !important"), this.attributes.style = Gh(t);
      }, t.removeProperty = (r) => {
        if (n.test(r))
          return "";
        const o = Xl(r), i = t[o] || "";
        return delete t[o], this.attributes.style = Gh(t), i;
      }, t;
    }
    getAttribute(t) {
      return this.attributes[t] || null;
    }
    setAttribute(t, n) {
      this.attributes[t] = n;
    }
    setAttributeNS(t, n, r) {
      this.setAttribute(n, r);
    }
    removeAttribute(t) {
      delete this.attributes[t];
    }
    appendChild(t) {
      return gd(this, t);
    }
    insertBefore(t, n) {
      return ay(this, t, n);
    }
    removeChild(t) {
      return ly(this, t);
    }
    attachShadow(t) {
      const n = this.ownerDocument.createElement("SHADOWROOT");
      return this.shadowRoot = n, n;
    }
    dispatchEvent(t) {
      return !0;
    }
    toString() {
      let t = "";
      for (const n in this.attributes)
        t += `${n}="${this.attributes[n]}" `;
      return `${this.tagName} ${t}`;
    }
  };
}
function oy(e) {
  return class extends e {
    constructor(t) {
      super(), this.nodeType = Qe.TEXT_NODE, this.nodeName = "#text", this.RRNodeType = Oe.Text, this.data = t;
    }
    get textContent() {
      return this.data;
    }
    set textContent(t) {
      this.data = t;
    }
    toString() {
      return `RRText text=${JSON.stringify(this.data)}`;
    }
  };
}
function iy(e) {
  return class extends e {
    constructor(t) {
      super(), this.nodeType = Qe.COMMENT_NODE, this.nodeName = "#comment", this.RRNodeType = Oe.Comment, this.data = t;
    }
    get textContent() {
      return this.data;
    }
    set textContent(t) {
      this.data = t;
    }
    toString() {
      return `RRComment text=${JSON.stringify(this.data)}`;
    }
  };
}
function sy(e) {
  return class extends e {
    constructor(t) {
      super(), this.nodeName = "#cdata-section", this.nodeType = Qe.CDATA_SECTION_NODE, this.RRNodeType = Oe.CDATA, this.data = t;
    }
    get textContent() {
      return this.data;
    }
    set textContent(t) {
      this.data = t;
    }
    toString() {
      return `RRCDATASection data=${JSON.stringify(this.data)}`;
    }
  };
}
class sT {
  constructor(t, n) {
    if (this.classes = [], this.add = (...r) => {
      for (const o of r) {
        const i = String(o);
        this.classes.indexOf(i) >= 0 || this.classes.push(i);
      }
      this.onChange && this.onChange(this.classes.join(" "));
    }, this.remove = (...r) => {
      this.classes = this.classes.filter((o) => r.indexOf(o) === -1), this.onChange && this.onChange(this.classes.join(" "));
    }, t) {
      const r = t.trim().split(/\s+/);
      this.classes.push(...r);
    }
    this.onChange = n;
  }
}
function gd(e, t) {
  return t.parentNode && t.parentNode.removeChild(t), e.lastChild ? (e.lastChild.nextSibling = t, t.previousSibling = e.lastChild) : (e.firstChild = t, t.previousSibling = null), e.lastChild = t, t.nextSibling = null, t.parentNode = e, t.parentElement = e, t.ownerDocument = e.ownerDocument, t;
}
function ay(e, t, n) {
  if (!n)
    return gd(e, t);
  if (n.parentNode !== e)
    throw new Error("Failed to execute 'insertBefore' on 'RRNode': The RRNode before which the new node is to be inserted is not a child of this RRNode.");
  return t === n || (t.parentNode && t.parentNode.removeChild(t), t.previousSibling = n.previousSibling, n.previousSibling = t, t.nextSibling = n, t.previousSibling ? t.previousSibling.nextSibling = t : e.firstChild = t, t.parentElement = e, t.parentNode = e, t.ownerDocument = e.ownerDocument), t;
}
function ly(e, t) {
  if (t.parentNode !== e)
    throw new Error("Failed to execute 'removeChild' on 'RRNode': The RRNode to be removed is not a child of this RRNode.");
  return t.previousSibling ? t.previousSibling.nextSibling = t.nextSibling : e.firstChild = t.nextSibling, t.nextSibling ? t.nextSibling.previousSibling = t.previousSibling : e.lastChild = t.previousSibling, t.previousSibling = null, t.nextSibling = null, t.parentElement = null, t.parentNode = null, t;
}
var Qe;
(function(e) {
  e[e.PLACEHOLDER = 0] = "PLACEHOLDER", e[e.ELEMENT_NODE = 1] = "ELEMENT_NODE", e[e.ATTRIBUTE_NODE = 2] = "ATTRIBUTE_NODE", e[e.TEXT_NODE = 3] = "TEXT_NODE", e[e.CDATA_SECTION_NODE = 4] = "CDATA_SECTION_NODE", e[e.ENTITY_REFERENCE_NODE = 5] = "ENTITY_REFERENCE_NODE", e[e.ENTITY_NODE = 6] = "ENTITY_NODE", e[e.PROCESSING_INSTRUCTION_NODE = 7] = "PROCESSING_INSTRUCTION_NODE", e[e.COMMENT_NODE = 8] = "COMMENT_NODE", e[e.DOCUMENT_NODE = 9] = "DOCUMENT_NODE", e[e.DOCUMENT_TYPE_NODE = 10] = "DOCUMENT_TYPE_NODE", e[e.DOCUMENT_FRAGMENT_NODE = 11] = "DOCUMENT_FRAGMENT_NODE";
})(Qe || (Qe = {}));
const hu = { svg: "http://www.w3.org/2000/svg", "xlink:href": "http://www.w3.org/1999/xlink", xmlns: "http://www.w3.org/2000/xmlns/" }, aT = { altglyph: "altGlyph", altglyphdef: "altGlyphDef", altglyphitem: "altGlyphItem", animatecolor: "animateColor", animatemotion: "animateMotion", animatetransform: "animateTransform", clippath: "clipPath", feblend: "feBlend", fecolormatrix: "feColorMatrix", fecomponenttransfer: "feComponentTransfer", fecomposite: "feComposite", feconvolvematrix: "feConvolveMatrix", fediffuselighting: "feDiffuseLighting", fedisplacementmap: "feDisplacementMap", fedistantlight: "feDistantLight", fedropshadow: "feDropShadow", feflood: "feFlood", fefunca: "feFuncA", fefuncb: "feFuncB", fefuncg: "feFuncG", fefuncr: "feFuncR", fegaussianblur: "feGaussianBlur", feimage: "feImage", femerge: "feMerge", femergenode: "feMergeNode", femorphology: "feMorphology", feoffset: "feOffset", fepointlight: "fePointLight", fespecularlighting: "feSpecularLighting", fespotlight: "feSpotLight", fetile: "feTile", feturbulence: "feTurbulence", foreignobject: "foreignObject", glyphref: "glyphRef", lineargradient: "linearGradient", radialgradient: "radialGradient" };
let an = null;
function Ka(e, t, n, r = t.mirror || t.ownerDocument.mirror) {
  e = function(o, i, s, a) {
    var l;
    if (s.afterAppend && !an && (an = /* @__PURE__ */ new WeakSet(), setTimeout(() => {
      an = null;
    }, 0)), !vd(o, i)) {
      const c = Ga(i, s.mirror, a);
      (l = o.parentNode) === null || l === void 0 || l.replaceChild(c, o), o = c;
    }
    switch (i.RRNodeType) {
      case Oe.Document:
        if (!fo(o, i, s.mirror, a)) {
          const c = a.getMeta(i);
          c && (s.mirror.removeNodeFromMap(o), o.close(), o.open(), s.mirror.add(o, c), an == null || an.add(o));
        }
        break;
      case Oe.Element: {
        const c = o, u = i;
        switch (u.tagName) {
          case "IFRAME": {
            const d = o.contentDocument;
            if (!d)
              break;
            Ka(d, i.contentDocument, s, a);
            break;
          }
        }
        u.shadowRoot && (c.shadowRoot || c.attachShadow({ mode: "open" }), Yh(c.shadowRoot, u.shadowRoot, s, a));
        break;
      }
    }
    return o;
  }(e, t, n, r), Yh(e, t, n, r), function(o, i, s, a) {
    var l;
    switch (i.RRNodeType) {
      case Oe.Document: {
        const c = i.scrollData;
        c && s.applyScroll(c, !0);
        break;
      }
      case Oe.Element: {
        const c = o, u = i;
        switch (function(d, f, m) {
          const h = d.attributes, p = f.attributes;
          for (const g in p) {
            const v = p[g], y = m.getMeta(f);
            if (y != null && y.isSVG && hu[g])
              d.setAttributeNS(hu[g], g, v);
            else if (f.tagName === "CANVAS" && g === "rr_dataURL") {
              const b = document.createElement("img");
              b.src = v, b.onload = () => {
                const E = d.getContext("2d");
                E && E.drawImage(b, 0, 0, b.width, b.height);
              };
            } else {
              if (f.tagName === "IFRAME" && g === "srcdoc")
                continue;
              d.setAttribute(g, v);
            }
          }
          for (const { name: g } of Array.from(h))
            g in p || d.removeAttribute(g);
          f.scrollLeft && (d.scrollLeft = f.scrollLeft), f.scrollTop && (d.scrollTop = f.scrollTop);
        }(c, u, a), u.scrollData && s.applyScroll(u.scrollData, !0), u.inputData && s.applyInput(u.inputData), u.tagName) {
          case "AUDIO":
          case "VIDEO": {
            const d = o, f = u;
            f.paused !== void 0 && (f.paused ? d.pause() : d.play()), f.muted !== void 0 && (d.muted = f.muted), f.volume !== void 0 && (d.volume = f.volume), f.currentTime !== void 0 && (d.currentTime = f.currentTime), f.playbackRate !== void 0 && (d.playbackRate = f.playbackRate);
            break;
          }
          case "CANVAS": {
            const d = i;
            if (d.rr_dataURL !== null) {
              const f = document.createElement("img");
              f.onload = () => {
                const m = c.getContext("2d");
                m && m.drawImage(f, 0, 0, f.width, f.height);
              }, f.src = d.rr_dataURL;
            }
            d.canvasMutations.forEach((f) => s.applyCanvas(f.event, f.mutation, o));
            break;
          }
          case "STYLE": {
            const d = c.sheet;
            d && i.rules.forEach((f) => s.applyStyleSheetMutation(f, d));
            break;
          }
        }
        break;
      }
      case Oe.Text:
      case Oe.Comment:
      case Oe.CDATA:
        o.textContent !== i.data && (o.textContent = i.data);
    }
    an != null && an.has(o) && (an.delete(o), (l = s.afterAppend) === null || l === void 0 || l.call(s, o, s.mirror.getId(o)));
  }(e, t, n, r);
}
function Yh(e, t, n, r) {
  const o = Array.from(e.childNodes), i = t.childNodes;
  if (o.length === 0 && i.length === 0)
    return;
  let s, a, l = 0, c = o.length - 1, u = 0, d = i.length - 1, f = o[l], m = o[c], h = i[u], p = i[d];
  for (; l <= c && u <= d; )
    if (f === void 0)
      f = o[++l];
    else if (m === void 0)
      m = o[--c];
    else if (fo(f, h, n.mirror, r))
      f = o[++l], h = i[++u];
    else if (fo(m, p, n.mirror, r))
      m = o[--c], p = i[--d];
    else if (fo(f, p, n.mirror, r)) {
      try {
        e.insertBefore(f, m.nextSibling);
      } catch (y) {
        console.warn(y);
      }
      f = o[++l], p = i[--d];
    } else if (fo(m, h, n.mirror, r)) {
      try {
        e.insertBefore(m, f);
      } catch (y) {
        console.warn(y);
      }
      m = o[--c], h = i[++u];
    } else {
      if (!s) {
        s = {};
        for (let b = l; b <= c; b++) {
          const E = o[b];
          E && n.mirror.hasNode(E) && (s[n.mirror.getId(E)] = b);
        }
      }
      a = s[r.getId(h)];
      const y = o[a];
      if (a !== void 0 && y && fo(y, h, n.mirror, r)) {
        try {
          e.insertBefore(y, f);
        } catch (b) {
          console.warn(b);
        }
        o[a] = void 0;
      } else {
        const b = Ga(h, n.mirror, r);
        e.nodeName === "#document" && f && (b.nodeType === b.DOCUMENT_TYPE_NODE && f.nodeType === f.DOCUMENT_TYPE_NODE || b.nodeType === b.ELEMENT_NODE && f.nodeType === f.ELEMENT_NODE) && (e.removeChild(f), n.mirror.removeNodeFromMap(f), f = o[++l]);
        try {
          e.insertBefore(b, f || null);
        } catch (E) {
          console.warn(E);
        }
      }
      h = i[++u];
    }
  if (l > c) {
    const y = i[d + 1];
    let b = null;
    for (y && (b = n.mirror.getNode(r.getId(y))); u <= d; ++u) {
      const E = Ga(i[u], n.mirror, r);
      try {
        e.insertBefore(E, b);
      } catch (S) {
        console.warn(S);
      }
    }
  } else if (u > d)
    for (; l <= c; l++) {
      const y = o[l];
      if (y && y.parentNode === e)
        try {
          e.removeChild(y), n.mirror.removeNodeFromMap(y);
        } catch (b) {
          console.warn(b);
        }
    }
  let g = e.firstChild, v = t.firstChild;
  for (; g !== null && v !== null; )
    Ka(g, v, n, r), g = g.nextSibling, v = v.nextSibling;
}
function Ga(e, t, n) {
  const r = n.getId(e), o = n.getMeta(e);
  let i = null;
  if (r > -1 && (i = t.getNode(r)), i !== null && vd(i, e))
    return i;
  switch (e.RRNodeType) {
    case Oe.Document:
      i = new Document();
      break;
    case Oe.DocumentType:
      i = document.implementation.createDocumentType(e.name, e.publicId, e.systemId);
      break;
    case Oe.Element: {
      let s = e.tagName.toLowerCase();
      s = aT[s] || s, i = o && "isSVG" in o && (o != null && o.isSVG) ? document.createElementNS(hu.svg, s) : document.createElement(e.tagName);
      break;
    }
    case Oe.Text:
      i = document.createTextNode(e.data);
      break;
    case Oe.Comment:
      i = document.createComment(e.data);
      break;
    case Oe.CDATA:
      i = document.createCDATASection(e.data);
  }
  o && t.add(i, Object.assign({}, o));
  try {
    an == null || an.add(i);
  } catch {
  }
  return i;
}
function vd(e, t) {
  return e.nodeType === t.nodeType && (e.nodeType !== e.ELEMENT_NODE || e.tagName.toUpperCase() === t.tagName);
}
function fo(e, t, n, r) {
  const o = n.getId(e), i = r.getId(t);
  return o !== -1 && o === i && vd(e, t);
}
class Yo extends (/* @__PURE__ */ function(t) {
  return class cy extends t {
    constructor(...r) {
      super(r), this.nodeType = Qe.DOCUMENT_NODE, this.nodeName = "#document", this.compatMode = "CSS1Compat", this.RRNodeType = Oe.Document, this.textContent = null, this.ownerDocument = this;
    }
    get documentElement() {
      return this.childNodes.find((r) => r.RRNodeType === Oe.Element && r.tagName === "HTML") || null;
    }
    get body() {
      var r;
      return ((r = this.documentElement) === null || r === void 0 ? void 0 : r.childNodes.find((o) => o.RRNodeType === Oe.Element && o.tagName === "BODY")) || null;
    }
    get head() {
      var r;
      return ((r = this.documentElement) === null || r === void 0 ? void 0 : r.childNodes.find((o) => o.RRNodeType === Oe.Element && o.tagName === "HEAD")) || null;
    }
    get implementation() {
      return this;
    }
    get firstElementChild() {
      return this.documentElement;
    }
    appendChild(r) {
      const o = r.RRNodeType;
      if ((o === Oe.Element || o === Oe.DocumentType) && this.childNodes.some((s) => s.RRNodeType === o))
        throw new Error(`RRDomException: Failed to execute 'appendChild' on 'RRNode': Only one ${o === Oe.Element ? "RRElement" : "RRDoctype"} on RRDocument allowed.`);
      const i = gd(this, r);
      return i.parentElement = null, i;
    }
    insertBefore(r, o) {
      const i = r.RRNodeType;
      if ((i === Oe.Element || i === Oe.DocumentType) && this.childNodes.some((a) => a.RRNodeType === i))
        throw new Error(`RRDomException: Failed to execute 'insertBefore' on 'RRNode': Only one ${i === Oe.Element ? "RRElement" : "RRDoctype"} on RRDocument allowed.`);
      const s = ay(this, r, o);
      return s.parentElement = null, s;
    }
    removeChild(r) {
      return ly(this, r);
    }
    open() {
      this.firstChild = null, this.lastChild = null;
    }
    close() {
    }
    write(r) {
      let o;
      if (r === '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "">' ? o = "-//W3C//DTD XHTML 1.0 Transitional//EN" : r === '<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" "">' && (o = "-//W3C//DTD HTML 4.0 Transitional//EN"), o) {
        const i = this.createDocumentType("html", o, "");
        this.open(), this.appendChild(i);
      }
    }
    createDocument(r, o, i) {
      return new cy();
    }
    createDocumentType(r, o, i) {
      const s = new (ny(Lt))(r, o, i);
      return s.ownerDocument = this, s;
    }
    createElement(r) {
      const o = new (ry(Lt))(r);
      return o.ownerDocument = this, o;
    }
    createElementNS(r, o) {
      return this.createElement(o);
    }
    createTextNode(r) {
      const o = new (oy(Lt))(r);
      return o.ownerDocument = this, o;
    }
    createComment(r) {
      const o = new (iy(Lt))(r);
      return o.ownerDocument = this, o;
    }
    createCDATASection(r) {
      const o = new (sy(Lt))(r);
      return o.ownerDocument = this, o;
    }
    toString() {
      return "RRDocument";
    }
  };
}(Lt)) {
  get unserializedId() {
    return this._unserializedId--;
  }
  constructor(t) {
    super(), this.UNSERIALIZED_STARTING_ID = -2, this._unserializedId = this.UNSERIALIZED_STARTING_ID, this.mirror = new vT(), this.scrollData = null, t && (this.mirror = t);
  }
  createDocument(t, n, r) {
    return new Yo();
  }
  createDocumentType(t, n, r) {
    const o = new lT(t, n, r);
    return o.ownerDocument = this, o;
  }
  createElement(t) {
    const n = t.toUpperCase();
    let r;
    switch (n) {
      case "AUDIO":
      case "VIDEO":
        r = new cT(n);
        break;
      case "IFRAME":
        r = new fT(n, this.mirror);
        break;
      case "CANVAS":
        r = new uT(n);
        break;
      case "STYLE":
        r = new dT(n);
        break;
      default:
        r = new xs(n);
    }
    return r.ownerDocument = this, r;
  }
  createComment(t) {
    const n = new pT(t);
    return n.ownerDocument = this, n;
  }
  createCDATASection(t) {
    const n = new mT(t);
    return n.ownerDocument = this, n;
  }
  createTextNode(t) {
    const n = new hT(t);
    return n.ownerDocument = this, n;
  }
  destroyTree() {
    this.firstChild = null, this.lastChild = null, this.mirror.reset();
  }
  open() {
    super.open(), this._unserializedId = this.UNSERIALIZED_STARTING_ID;
  }
}
const lT = ny(Lt);
class xs extends ry(Lt) {
  constructor() {
    super(...arguments), this.inputData = null, this.scrollData = null;
  }
}
class cT extends (/* @__PURE__ */ function(t) {
  return class extends t {
    attachShadow(n) {
      throw new Error("RRDomException: Failed to execute 'attachShadow' on 'RRElement': This RRElement does not support attachShadow");
    }
    play() {
      this.paused = !1;
    }
    pause() {
      this.paused = !0;
    }
  };
}(xs)) {
}
class uT extends xs {
  constructor() {
    super(...arguments), this.rr_dataURL = null, this.canvasMutations = [];
  }
  getContext() {
    return null;
  }
}
class dT extends xs {
  constructor() {
    super(...arguments), this.rules = [];
  }
}
class fT extends xs {
  constructor(t, n) {
    super(t), this.contentDocument = new Yo(), this.contentDocument.mirror = n;
  }
}
const hT = oy(Lt), pT = iy(Lt), mT = sy(Lt);
function uy(e, t, n, r) {
  let o;
  switch (e.nodeType) {
    case Qe.DOCUMENT_NODE:
      r && r.nodeName === "IFRAME" ? o = r.contentDocument : (o = t, o.compatMode = e.compatMode);
      break;
    case Qe.DOCUMENT_TYPE_NODE: {
      const s = e;
      o = t.createDocumentType(s.name, s.publicId, s.systemId);
      break;
    }
    case Qe.ELEMENT_NODE: {
      const s = e, a = function(c) {
        return c instanceof HTMLFormElement ? "FORM" : c.tagName.toUpperCase();
      }(s);
      o = t.createElement(a);
      const l = o;
      for (const { name: c, value: u } of Array.from(s.attributes))
        l.attributes[c] = u;
      s.scrollLeft && (l.scrollLeft = s.scrollLeft), s.scrollTop && (l.scrollTop = s.scrollTop);
      break;
    }
    case Qe.TEXT_NODE:
      o = t.createTextNode(e.textContent || "");
      break;
    case Qe.CDATA_SECTION_NODE:
      o = t.createCDATASection(e.data);
      break;
    case Qe.COMMENT_NODE:
      o = t.createComment(e.textContent || "");
      break;
    case Qe.DOCUMENT_FRAGMENT_NODE:
      o = r.attachShadow({ mode: "open" });
      break;
    default:
      return null;
  }
  let i = n.getMeta(e);
  return t instanceof Yo && (i || (i = dy(o, t.unserializedId), n.add(e, i)), t.mirror.add(o, Object.assign({}, i))), o;
}
function gT(e, t = function() {
  return new tT();
}(), n = new Yo()) {
  return function r(o, i) {
    const s = uy(o, n, t, i);
    if (s !== null)
      if ((i == null ? void 0 : i.nodeName) !== "IFRAME" && o.nodeType !== Qe.DOCUMENT_FRAGMENT_NODE && (i == null || i.appendChild(s), s.parentNode = i, s.parentElement = i), o.nodeName === "IFRAME") {
        const a = o.contentDocument;
        a && r(a, s);
      } else
        o.nodeType !== Qe.DOCUMENT_NODE && o.nodeType !== Qe.ELEMENT_NODE && o.nodeType !== Qe.DOCUMENT_FRAGMENT_NODE || (o.nodeType === Qe.ELEMENT_NODE && o.shadowRoot && r(o.shadowRoot, s), o.childNodes.forEach((a) => r(a, s)));
  }(e, null), n;
}
class vT {
  constructor() {
    this.idNodeMap = /* @__PURE__ */ new Map(), this.nodeMetaMap = /* @__PURE__ */ new WeakMap();
  }
  getId(t) {
    var n;
    if (!t)
      return -1;
    const r = (n = this.getMeta(t)) === null || n === void 0 ? void 0 : n.id;
    return r ?? -1;
  }
  getNode(t) {
    return this.idNodeMap.get(t) || null;
  }
  getIds() {
    return Array.from(this.idNodeMap.keys());
  }
  getMeta(t) {
    return this.nodeMetaMap.get(t) || null;
  }
  removeNodeFromMap(t) {
    const n = this.getId(t);
    this.idNodeMap.delete(n), t.childNodes && t.childNodes.forEach((r) => this.removeNodeFromMap(r));
  }
  has(t) {
    return this.idNodeMap.has(t);
  }
  hasNode(t) {
    return this.nodeMetaMap.has(t);
  }
  add(t, n) {
    const r = n.id;
    this.idNodeMap.set(r, t), this.nodeMetaMap.set(t, n);
  }
  replace(t, n) {
    const r = this.getNode(t);
    if (r) {
      const o = this.nodeMetaMap.get(r);
      o && this.nodeMetaMap.set(n, o);
    }
    this.idNodeMap.set(t, n);
  }
  reset() {
    this.idNodeMap = /* @__PURE__ */ new Map(), this.nodeMetaMap = /* @__PURE__ */ new WeakMap();
  }
}
function dy(e, t) {
  switch (e.RRNodeType) {
    case Oe.Document:
      return { id: t, type: e.RRNodeType, childNodes: [] };
    case Oe.DocumentType: {
      const n = e;
      return { id: t, type: e.RRNodeType, name: n.name, publicId: n.publicId, systemId: n.systemId };
    }
    case Oe.Element:
      return { id: t, type: e.RRNodeType, tagName: e.tagName.toLowerCase(), attributes: {}, childNodes: [] };
    case Oe.Text:
    case Oe.Comment:
      return { id: t, type: e.RRNodeType, textContent: e.textContent || "" };
    case Oe.CDATA:
      return { id: t, type: e.RRNodeType, textContent: "" };
  }
}
var Ut = Uint8Array, Gn = Uint16Array, pu = Uint32Array, fy = new Ut([0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 2, 2, 2, 2, 3, 3, 3, 3, 4, 4, 4, 4, 5, 5, 5, 5, 0, 0, 0, 0]), hy = new Ut([0, 0, 0, 0, 1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6, 7, 7, 8, 8, 9, 9, 10, 10, 11, 11, 12, 12, 13, 13, 0, 0]), yT = new Ut([16, 17, 18, 0, 8, 7, 9, 6, 10, 5, 11, 4, 12, 3, 13, 2, 14, 1, 15]), py = function(e, t) {
  for (var n = new Gn(31), r = 0; r < 31; ++r)
    n[r] = t += 1 << e[r - 1];
  var o = new pu(n[30]);
  for (r = 1; r < 30; ++r)
    for (var i = n[r]; i < n[r + 1]; ++i)
      o[i] = i - n[r] << 5 | r;
  return [n, o];
}, my = py(fy, 2), gy = my[0], bT = my[1];
gy[28] = 258, bT[258] = 28;
for (var CT = py(hy, 0)[0], mu = new Gn(32768), qe = 0; qe < 32768; ++qe) {
  var pr = (43690 & qe) >>> 1 | (21845 & qe) << 1;
  pr = (61680 & (pr = (52428 & pr) >>> 2 | (13107 & pr) << 2)) >>> 4 | (3855 & pr) << 4, mu[qe] = ((65280 & pr) >>> 8 | (255 & pr) << 8) >>> 1;
}
var Ri = function(e, t, n) {
  for (var r = e.length, o = 0, i = new Gn(t); o < r; ++o)
    ++i[e[o] - 1];
  var s, a = new Gn(t);
  for (o = 0; o < t; ++o)
    a[o] = a[o - 1] + i[o - 1] << 1;
  if (n) {
    s = new Gn(1 << t);
    var l = 15 - t;
    for (o = 0; o < r; ++o)
      if (e[o])
        for (var c = o << 4 | e[o], u = t - e[o], d = a[e[o] - 1]++ << u, f = d | (1 << u) - 1; d <= f; ++d)
          s[mu[d] >>> l] = c;
  } else
    for (s = new Gn(r), o = 0; o < r; ++o)
      s[o] = mu[a[e[o] - 1]++] >>> 15 - e[o];
  return s;
}, Ss = new Ut(288);
for (qe = 0; qe < 144; ++qe)
  Ss[qe] = 8;
for (qe = 144; qe < 256; ++qe)
  Ss[qe] = 9;
for (qe = 256; qe < 280; ++qe)
  Ss[qe] = 7;
for (qe = 280; qe < 288; ++qe)
  Ss[qe] = 8;
var vy = new Ut(32);
for (qe = 0; qe < 32; ++qe)
  vy[qe] = 5;
var wT = Ri(Ss, 9, 1), xT = Ri(vy, 5, 1), Jl = function(e) {
  for (var t = e[0], n = 1; n < e.length; ++n)
    e[n] > t && (t = e[n]);
  return t;
}, Gt = function(e, t, n) {
  var r = t / 8 >> 0;
  return (e[r] | e[r + 1] << 8) >>> (7 & t) & n;
}, Ql = function(e, t) {
  var n = t / 8 >> 0;
  return (e[n] | e[n + 1] << 8 | e[n + 2] << 16) >>> (7 & t);
}, yy = function(e, t, n) {
  (t == null || t < 0) && (t = 0), (n == null || n > e.length) && (n = e.length);
  var r = new (e instanceof Gn ? Gn : e instanceof pu ? pu : Ut)(n - t);
  return r.set(e.subarray(t, n)), r;
};
function ST(e, t) {
  return function(n, r, o) {
    var i = n.length, s = !r || o, a = !o || o.i;
    o || (o = {}), r || (r = new Ut(3 * i));
    var l, c = function(ee) {
      var we = r.length;
      if (ee > we) {
        var me = new Ut(Math.max(2 * we, ee));
        me.set(r), r = me;
      }
    }, u = o.f || 0, d = o.p || 0, f = o.b || 0, m = o.l, h = o.d, p = o.m, g = o.n, v = 8 * i;
    do {
      if (!m) {
        o.f = u = Gt(n, d, 1);
        var y = Gt(n, d + 1, 3);
        if (d += 3, !y) {
          var b = n[(D = ((l = d) / 8 >> 0) + (7 & l && 1) + 4) - 4] | n[D - 3] << 8, E = D + b;
          if (E > i) {
            if (a)
              throw "unexpected EOF";
            break;
          }
          s && c(f + b), r.set(n.subarray(D, E), f), o.b = f += b, o.p = d = 8 * E;
          continue;
        }
        if (y == 1)
          m = wT, h = xT, p = 9, g = 5;
        else {
          if (y != 2)
            throw "invalid block type";
          var S = Gt(n, d, 31) + 257, T = Gt(n, d + 10, 15) + 4, C = S + Gt(n, d + 5, 31) + 1;
          d += 14;
          for (var _ = new Ut(C), w = new Ut(19), R = 0; R < T; ++R)
            w[yT[R]] = Gt(n, d + 3 * R, 7);
          d += 3 * T;
          var O = Jl(w), I = (1 << O) - 1;
          if (!a && d + C * (O + 7) > v)
            break;
          var L = Ri(w, O, 1);
          for (R = 0; R < C; ) {
            var D, P = L[Gt(n, d, I)];
            if (d += 15 & P, (D = P >>> 4) < 16)
              _[R++] = D;
            else {
              var k = 0, N = 0;
              for (D == 16 ? (N = 3 + Gt(n, d, 3), d += 2, k = _[R - 1]) : D == 17 ? (N = 3 + Gt(n, d, 7), d += 3) : D == 18 && (N = 11 + Gt(n, d, 127), d += 7); N--; )
                _[R++] = k;
            }
          }
          var $ = _.subarray(0, S), B = _.subarray(S);
          p = Jl($), g = Jl(B), m = Ri($, p, 1), h = Ri(B, g, 1);
        }
        if (d > v)
          throw "unexpected EOF";
      }
      s && c(f + 131072);
      for (var U = (1 << p) - 1, J = (1 << g) - 1, te = p + g + 18; a || d + te < v; ) {
        var ie = (k = m[Ql(n, d) & U]) >>> 4;
        if ((d += 15 & k) > v)
          throw "unexpected EOF";
        if (!k)
          throw "invalid length/literal";
        if (ie < 256)
          r[f++] = ie;
        else {
          if (ie == 256) {
            m = null;
            break;
          }
          var z = ie - 254;
          if (ie > 264) {
            var le = fy[R = ie - 257];
            z = Gt(n, d, (1 << le) - 1) + gy[R], d += le;
          }
          var j = h[Ql(n, d) & J], pe = j >>> 4;
          if (!j)
            throw "invalid distance";
          if (d += 15 & j, B = CT[pe], pe > 3 && (le = hy[pe], B += Ql(n, d) & (1 << le) - 1, d += le), d > v)
            throw "unexpected EOF";
          s && c(f + 131072);
          for (var ne = f + z; f < ne; f += 4)
            r[f] = r[f - B], r[f + 1] = r[f + 1 - B], r[f + 2] = r[f + 2 - B], r[f + 3] = r[f + 3 - B];
          f = ne;
        }
      }
      o.l = m, o.p = d, o.b = f, m && (u = 1, o.m = p, o.d = h, o.n = g);
    } while (!u);
    return f == r.length ? r : yy(r, 0, f);
  }((function(n) {
    if ((15 & n[0]) != 8 || n[0] >>> 4 > 7 || (n[0] << 8 | n[1]) % 31)
      throw "invalid zlib data";
    if (32 & n[1])
      throw "invalid zlib data: preset dictionaries not supported";
  }(e), e.subarray(2, -4)), t);
}
const ET = (e) => {
  if (typeof e != "string")
    return e;
  try {
    const t = JSON.parse(e);
    if (t.timestamp)
      return t;
  } catch {
  }
  try {
    const t = JSON.parse(function(n, r) {
      var o = "";
      if (!r && typeof TextDecoder < "u")
        return new TextDecoder().decode(n);
      for (var i = 0; i < n.length; ) {
        var s = n[i++];
        s < 128 || r ? o += String.fromCharCode(s) : s < 224 ? o += String.fromCharCode((31 & s) << 6 | 63 & n[i++]) : s < 240 ? o += String.fromCharCode((15 & s) << 12 | (63 & n[i++]) << 6 | 63 & n[i++]) : (s = ((15 & s) << 18 | (63 & n[i++]) << 12 | (63 & n[i++]) << 6 | 63 & n[i++]) - 65536, o += String.fromCharCode(55296 | s >> 10, 56320 | 1023 & s));
      }
      return o;
    }(ST(function(n, r) {
      var o = n.length;
      if (!r && typeof TextEncoder < "u")
        return new TextEncoder().encode(n);
      for (var i = new Ut(n.length + (n.length >>> 1)), s = 0, a = function(d) {
        i[s++] = d;
      }, l = 0; l < o; ++l) {
        if (s + 5 > i.length) {
          var c = new Ut(s + 8 + (o - l << 1));
          c.set(i), i = c;
        }
        var u = n.charCodeAt(l);
        u < 128 || r ? a(u) : u < 2048 ? (a(192 | u >>> 6), a(128 | 63 & u)) : u > 55295 && u < 57344 ? (a(240 | (u = 65536 + (1047552 & u) | 1023 & n.charCodeAt(++l)) >>> 18), a(128 | u >>> 12 & 63), a(128 | u >>> 6 & 63), a(128 | 63 & u)) : (a(224 | u >>> 12), a(128 | u >>> 6 & 63), a(128 | 63 & u));
      }
      return yy(i, 0, s);
    }(e, !0))));
    if (t.v === "v1")
      return t;
    throw new Error(`These events were packed with packer ${t.v} which is incompatible with current packer v1.`);
  } catch (t) {
    throw console.error(t), new Error("Unknown data format.");
  }
};
function by(e) {
  return { all: e = e || /* @__PURE__ */ new Map(), on: function(t, n) {
    var r = e.get(t);
    r ? r.push(n) : e.set(t, [n]);
  }, off: function(t, n) {
    var r = e.get(t);
    r && (n ? r.splice(r.indexOf(n) >>> 0, 1) : e.set(t, []));
  }, emit: function(t, n) {
    var r = e.get(t);
    r && r.slice().map(function(o) {
      o(n);
    }), (r = e.get("*")) && r.slice().map(function(o) {
      o(t, n);
    });
  } };
}
var yo, _T = Object.freeze({ __proto__: null, default: by });
function IT(e = window, t = document) {
  if ("scrollBehavior" in t.documentElement.style && e.__forceSmoothScrollPolyfill__ !== !0)
    return;
  const n = e.HTMLElement || e.Element, r = { scroll: e.scroll || e.scrollTo, scrollBy: e.scrollBy, elementScroll: n.prototype.scroll || a, scrollIntoView: n.prototype.scrollIntoView }, o = e.performance && e.performance.now ? e.performance.now.bind(e.performance) : Date.now, i = (s = e.navigator.userAgent, new RegExp(["MSIE ", "Trident/", "Edge/"].join("|")).test(s) ? 1 : 0);
  var s;
  function a(p, g) {
    this.scrollLeft = p, this.scrollTop = g;
  }
  function l(p) {
    if (p === null || typeof p != "object" || p.behavior === void 0 || p.behavior === "auto" || p.behavior === "instant")
      return !0;
    if (typeof p == "object" && p.behavior === "smooth")
      return !1;
    throw new TypeError("behavior member of ScrollOptions " + p.behavior + " is not a valid value for enumeration ScrollBehavior.");
  }
  function c(p, g) {
    return g === "Y" ? p.clientHeight + i < p.scrollHeight : g === "X" ? p.clientWidth + i < p.scrollWidth : void 0;
  }
  function u(p, g) {
    const v = e.getComputedStyle(p, null)["overflow" + g];
    return v === "auto" || v === "scroll";
  }
  function d(p) {
    const g = c(p, "Y") && u(p, "Y"), v = c(p, "X") && u(p, "X");
    return g || v;
  }
  function f(p) {
    for (; p !== t.body && d(p) === !1; )
      p = p.parentNode || p.host;
    return p;
  }
  function m(p) {
    let g, v, y, b = (o() - p.startTime) / 468;
    var E;
    b = b > 1 ? 1 : b, E = b, g = 0.5 * (1 - Math.cos(Math.PI * E)), v = p.startX + (p.x - p.startX) * g, y = p.startY + (p.y - p.startY) * g, p.method.call(p.scrollable, v, y), v === p.x && y === p.y || e.requestAnimationFrame(m.bind(e, p));
  }
  function h(p, g, v) {
    let y, b, E, S;
    const T = o();
    p === t.body ? (y = e, b = e.scrollX || e.pageXOffset, E = e.scrollY || e.pageYOffset, S = r.scroll) : (y = p, b = p.scrollLeft, E = p.scrollTop, S = a), m({ scrollable: y, method: S, startTime: T, startX: b, startY: E, x: g, y: v });
  }
  e.scroll = e.scrollTo = function() {
    arguments[0] !== void 0 && (l(arguments[0]) !== !0 ? h.call(e, t.body, arguments[0].left !== void 0 ? ~~arguments[0].left : e.scrollX || e.pageXOffset, arguments[0].top !== void 0 ? ~~arguments[0].top : e.scrollY || e.pageYOffset) : r.scroll.call(e, arguments[0].left !== void 0 ? arguments[0].left : typeof arguments[0] != "object" ? arguments[0] : e.scrollX || e.pageXOffset, arguments[0].top !== void 0 ? arguments[0].top : arguments[1] !== void 0 ? arguments[1] : e.scrollY || e.pageYOffset));
  }, e.scrollBy = function() {
    arguments[0] !== void 0 && (l(arguments[0]) ? r.scrollBy.call(e, arguments[0].left !== void 0 ? arguments[0].left : typeof arguments[0] != "object" ? arguments[0] : 0, arguments[0].top !== void 0 ? arguments[0].top : arguments[1] !== void 0 ? arguments[1] : 0) : h.call(e, t.body, ~~arguments[0].left + (e.scrollX || e.pageXOffset), ~~arguments[0].top + (e.scrollY || e.pageYOffset)));
  }, n.prototype.scroll = n.prototype.scrollTo = function() {
    if (arguments[0] === void 0)
      return;
    if (l(arguments[0]) === !0) {
      if (typeof arguments[0] == "number" && arguments[1] === void 0)
        throw new SyntaxError("Value could not be converted");
      return void r.elementScroll.call(this, arguments[0].left !== void 0 ? ~~arguments[0].left : typeof arguments[0] != "object" ? ~~arguments[0] : this.scrollLeft, arguments[0].top !== void 0 ? ~~arguments[0].top : arguments[1] !== void 0 ? ~~arguments[1] : this.scrollTop);
    }
    const p = arguments[0].left, g = arguments[0].top;
    h.call(this, this, p === void 0 ? this.scrollLeft : ~~p, g === void 0 ? this.scrollTop : ~~g);
  }, n.prototype.scrollBy = function() {
    arguments[0] !== void 0 && (l(arguments[0]) !== !0 ? this.scroll({ left: ~~arguments[0].left + this.scrollLeft, top: ~~arguments[0].top + this.scrollTop, behavior: arguments[0].behavior }) : r.elementScroll.call(this, arguments[0].left !== void 0 ? ~~arguments[0].left + this.scrollLeft : ~~arguments[0] + this.scrollLeft, arguments[0].top !== void 0 ? ~~arguments[0].top + this.scrollTop : ~~arguments[1] + this.scrollTop));
  }, n.prototype.scrollIntoView = function() {
    if (l(arguments[0]) === !0)
      return void r.scrollIntoView.call(this, arguments[0] === void 0 || arguments[0]);
    const p = f(this), g = p.getBoundingClientRect(), v = this.getBoundingClientRect();
    p !== t.body ? (h.call(this, p, p.scrollLeft + v.left - g.left, p.scrollTop + v.top - g.top), e.getComputedStyle(p).position !== "fixed" && e.scrollBy({ left: g.left, top: g.top, behavior: "smooth" })) : e.scrollBy({ left: v.left, top: v.top, behavior: "smooth" });
  };
}
class NT {
  constructor(t = [], n) {
    this.timeOffset = 0, this.raf = null, this.actions = t, this.speed = n.speed;
  }
  addAction(t) {
    const n = this.raf === !0;
    if (!this.actions.length || this.actions[this.actions.length - 1].delay <= t.delay)
      this.actions.push(t);
    else {
      const r = this.findActionIndex(t);
      this.actions.splice(r, 0, t);
    }
    n && (this.raf = requestAnimationFrame(this.rafCheck.bind(this)));
  }
  start() {
    this.timeOffset = 0, this.lastTimestamp = performance.now(), this.raf = requestAnimationFrame(this.rafCheck.bind(this));
  }
  rafCheck() {
    const t = performance.now();
    for (this.timeOffset += (t - this.lastTimestamp) * this.speed, this.lastTimestamp = t; this.actions.length; ) {
      const n = this.actions[0];
      if (!(this.timeOffset >= n.delay))
        break;
      this.actions.shift(), n.doAction();
    }
    this.actions.length > 0 ? this.raf = requestAnimationFrame(this.rafCheck.bind(this)) : this.raf = !0;
  }
  clear() {
    this.raf && (this.raf !== !0 && cancelAnimationFrame(this.raf), this.raf = null), this.actions.length = 0;
  }
  setSpeed(t) {
    this.speed = t;
  }
  isActive() {
    return this.raf !== null;
  }
  findActionIndex(t) {
    let n = 0, r = this.actions.length - 1;
    for (; n <= r; ) {
      const o = Math.floor((n + r) / 2);
      if (this.actions[o].delay < t.delay)
        n = o + 1;
      else {
        if (!(this.actions[o].delay > t.delay))
          return o + 1;
        r = o - 1;
      }
    }
    return n;
  }
}
function qh(e, t) {
  if (e.type === Ue.IncrementalSnapshot && e.data.source === $e.MouseMove && e.data.positions && e.data.positions.length) {
    const n = e.data.positions[0].timeOffset, r = e.timestamp + n;
    return e.delay = r - t, r - t;
  }
  return e.delay = e.timestamp - t, e.delay;
}
/*! *****************************************************************************
Copyright (c) Microsoft Corporation.

Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted.

THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
PERFORMANCE OF THIS SOFTWARE.
***************************************************************************** */
function Zh(e, t) {
  var n = typeof Symbol == "function" && e[Symbol.iterator];
  if (!n)
    return e;
  var r, o, i = n.call(e), s = [];
  try {
    for (; (t === void 0 || t-- > 0) && !(r = i.next()).done; )
      s.push(r.value);
  } catch (a) {
    o = { error: a };
  } finally {
    try {
      r && !r.done && (n = i.return) && n.call(i);
    } finally {
      if (o)
        throw o.error;
    }
  }
  return s;
}
(function(e) {
  e[e.NotStarted = 0] = "NotStarted", e[e.Running = 1] = "Running", e[e.Stopped = 2] = "Stopped";
})(yo || (yo = {}));
var Cy = { type: "xstate.init" };
function ec(e) {
  return e === void 0 ? [] : [].concat(e);
}
function ho(e) {
  return { type: "xstate.assign", assignment: e };
}
function Xh(e, t) {
  return typeof (e = typeof e == "string" && t && t[e] ? t[e] : e) == "string" ? { type: e } : typeof e == "function" ? { type: e.name, exec: e } : e;
}
function Ya(e) {
  return function(t) {
    return e === t;
  };
}
function wy(e) {
  return typeof e == "string" ? { type: e } : e;
}
function Jh(e, t) {
  return { value: e, context: t, actions: [], changed: !1, matches: Ya(e) };
}
function Qh(e, t, n) {
  var r = t, o = !1;
  return [e.filter(function(i) {
    if (i.type === "xstate.assign") {
      o = !0;
      var s = Object.assign({}, r);
      return typeof i.assignment == "function" ? s = i.assignment(r, n) : Object.keys(i.assignment).forEach(function(a) {
        s[a] = typeof i.assignment[a] == "function" ? i.assignment[a](r, n) : i.assignment[a];
      }), r = s, !1;
    }
    return !0;
  }), r, o];
}
function xy(e, t) {
  t === void 0 && (t = {});
  var n = Zh(Qh(ec(e.states[e.initial].entry).map(function(s) {
    return Xh(s, t.actions);
  }), e.context, Cy), 2), r = n[0], o = n[1], i = { config: e, _options: t, initialState: { value: e.initial, actions: r, context: o, matches: Ya(e.initial) }, transition: function(s, a) {
    var l, c, u = typeof s == "string" ? { value: s, context: e.context } : s, d = u.value, f = u.context, m = wy(a), h = e.states[d];
    if (h.on) {
      var p = ec(h.on[m.type]);
      try {
        for (var g = function(N) {
          var $ = typeof Symbol == "function" && Symbol.iterator, B = $ && N[$], U = 0;
          if (B)
            return B.call(N);
          if (N && typeof N.length == "number")
            return { next: function() {
              return N && U >= N.length && (N = void 0), { value: N && N[U++], done: !N };
            } };
          throw new TypeError($ ? "Object is not iterable." : "Symbol.iterator is not defined.");
        }(p), v = g.next(); !v.done; v = g.next()) {
          var y = v.value;
          if (y === void 0)
            return Jh(d, f);
          var b = typeof y == "string" ? { target: y } : y, E = b.target, S = b.actions, T = S === void 0 ? [] : S, C = b.cond, _ = C === void 0 ? function() {
            return !0;
          } : C, w = E === void 0, R = E ?? d, O = e.states[R];
          if (_(f, m)) {
            var I = Zh(Qh((w ? ec(T) : [].concat(h.exit, T, O.entry).filter(function(N) {
              return N;
            })).map(function(N) {
              return Xh(N, i._options.actions);
            }), f, m), 3), L = I[0], D = I[1], P = I[2], k = E ?? d;
            return { value: k, context: D, actions: L, changed: E !== d || L.length > 0 || P, matches: Ya(k) };
          }
        }
      } catch (N) {
        l = { error: N };
      } finally {
        try {
          v && !v.done && (c = g.return) && c.call(g);
        } finally {
          if (l)
            throw l.error;
        }
      }
    }
    return Jh(d, f);
  } };
  return i;
}
var ep = function(e, t) {
  return e.actions.forEach(function(n) {
    var r = n.exec;
    return r && r(e.context, t);
  });
};
function Sy(e) {
  var t = e.initialState, n = yo.NotStarted, r = /* @__PURE__ */ new Set(), o = { _machine: e, send: function(i) {
    n === yo.Running && (t = e.transition(t, i), ep(t, wy(i)), r.forEach(function(s) {
      return s(t);
    }));
  }, subscribe: function(i) {
    return r.add(i), i(t), { unsubscribe: function() {
      return r.delete(i);
    } };
  }, start: function(i) {
    if (i) {
      var s = typeof i == "object" ? i : { context: e.config.context, value: i };
      t = { value: s.value, actions: [], context: s.context, matches: Ya(s.value) };
    }
    return n = yo.Running, ep(t, Cy), o;
  }, stop: function() {
    return n = yo.Stopped, r.clear(), o;
  }, get state() {
    return t;
  }, get status() {
    return n;
  } };
  return o;
}
function TT(e, { getCastFn: t, applyEventsSynchronously: n, emitter: r }) {
  const o = xy({ id: "player", context: e, initial: "paused", states: { playing: { on: { PAUSE: { target: "paused", actions: ["pause"] }, CAST_EVENT: { target: "playing", actions: "castEvent" }, END: { target: "paused", actions: ["resetLastPlayedEvent", "pause"] }, ADD_EVENT: { target: "playing", actions: ["addEvent"] } } }, paused: { on: { PLAY: { target: "playing", actions: ["recordTimeOffset", "play"] }, CAST_EVENT: { target: "paused", actions: "castEvent" }, TO_LIVE: { target: "live", actions: ["startLive"] }, ADD_EVENT: { target: "paused", actions: ["addEvent"] } } }, live: { on: { ADD_EVENT: { target: "live", actions: ["addEvent"] }, CAST_EVENT: { target: "live", actions: ["castEvent"] } } } } }, { actions: { castEvent: ho({ lastPlayedEvent: (i, s) => s.type === "CAST_EVENT" ? s.payload.event : i.lastPlayedEvent }), recordTimeOffset: ho((i, s) => {
    let a = i.timeOffset;
    return "payload" in s && "timeOffset" in s.payload && (a = s.payload.timeOffset), Object.assign(Object.assign({}, i), { timeOffset: a, baselineTime: i.events[0].timestamp + a });
  }), play(i) {
    var s;
    const { timer: a, events: l, baselineTime: c, lastPlayedEvent: u } = i;
    a.clear();
    for (const h of l)
      qh(h, c);
    const d = function(h, p) {
      for (let g = h.length - 1; g >= 0; g--) {
        const v = h[g];
        if (v.type === Ue.Meta && v.timestamp <= p)
          return h.slice(g);
      }
      return h;
    }(l, c);
    let f = u == null ? void 0 : u.timestamp;
    (u == null ? void 0 : u.type) === Ue.IncrementalSnapshot && u.data.source === $e.MouseMove && (f = u.timestamp + ((s = u.data.positions[0]) === null || s === void 0 ? void 0 : s.timeOffset)), c < (f || 0) && r.emit(Be.PlayBack);
    const m = new Array();
    for (const h of d)
      if (!(f && f < c && (h.timestamp <= f || h === u)))
        if (h.timestamp < c)
          m.push(h);
        else {
          const p = t(h, !1);
          a.addAction({ doAction: () => {
            p();
          }, delay: h.delay });
        }
    n(m), r.emit(Be.Flush), a.start();
  }, pause(i) {
    i.timer.clear();
  }, resetLastPlayedEvent: ho((i) => Object.assign(Object.assign({}, i), { lastPlayedEvent: null })), startLive: ho({ baselineTime: (i, s) => (i.timer.start(), s.type === "TO_LIVE" && s.payload.baselineTime ? s.payload.baselineTime : Date.now()) }), addEvent: ho((i, s) => {
    const { baselineTime: a, timer: l, events: c } = i;
    if (s.type === "ADD_EVENT") {
      const { event: u } = s.payload;
      qh(u, a);
      let d = c.length - 1;
      if (!c[d] || c[d].timestamp <= u.timestamp)
        c.push(u);
      else {
        let h = -1, p = 0;
        for (; p <= d; ) {
          const g = Math.floor((p + d) / 2);
          c[g].timestamp <= u.timestamp ? p = g + 1 : d = g - 1;
        }
        h === -1 && (h = p), c.splice(h, 0, u);
      }
      const f = u.timestamp < a, m = t(u, f);
      f ? m() : l.isActive() && l.addAction({ doAction: () => {
        m();
      }, delay: u.delay });
    }
    return Object.assign(Object.assign({}, i), { events: c });
  }) } });
  return Sy(o);
}
const tp = /* @__PURE__ */ new Map();
function Ey(e, t) {
  let n = tp.get(e);
  return n || (n = /* @__PURE__ */ new Map(), tp.set(e, n)), n.has(t) || n.set(t, []), n.get(t);
}
function Yn(e, t, n) {
  return (r) => Jn(this, void 0, void 0, function* () {
    if (r && typeof r == "object" && "rr_type" in r) {
      if (n && (n.isUnchanged = !1), r.rr_type === "ImageBitmap" && "args" in r) {
        const o = yield Yn(e, t, n)(r.args);
        return yield createImageBitmap.apply(null, o);
      }
      if ("index" in r) {
        if (n || t === null)
          return r;
        const { rr_type: o, index: i } = r;
        return Ey(t, o)[i];
      }
      if ("args" in r) {
        const { rr_type: o, args: i } = r;
        return new window[o](...yield Promise.all(i.map(Yn(e, t, n))));
      }
      if ("base64" in r)
        return function(o) {
          var i, s, a, l, c, u = 0.75 * o.length, d = o.length, f = 0;
          o[o.length - 1] === "=" && (u--, o[o.length - 2] === "=" && u--);
          var m = new ArrayBuffer(u), h = new Uint8Array(m);
          for (i = 0; i < d; i += 4)
            s = gi[o.charCodeAt(i)], a = gi[o.charCodeAt(i + 1)], l = gi[o.charCodeAt(i + 2)], c = gi[o.charCodeAt(i + 3)], h[f++] = s << 2 | a >> 4, h[f++] = (15 & a) << 4 | l >> 2, h[f++] = (3 & l) << 6 | 63 & c;
          return m;
        }(r.base64);
      if ("src" in r) {
        const o = e.get(r.src);
        if (o)
          return o;
        {
          const i = new Image();
          return i.src = r.src, e.set(r.src, i), i;
        }
      }
      if ("data" in r && r.rr_type === "Blob") {
        const o = yield Promise.all(r.data.map(Yn(e, t, n)));
        return new Blob(o, { type: r.type });
      }
    } else if (Array.isArray(r))
      return yield Promise.all(r.map(Yn(e, t, n)));
    return r;
  });
}
const OT = ["WebGLActiveInfo", "WebGLBuffer", "WebGLFramebuffer", "WebGLProgram", "WebGLRenderbuffer", "WebGLShader", "WebGLShaderPrecisionFormat", "WebGLTexture", "WebGLUniformLocation", "WebGLVertexArrayObject"];
function AT({ mutation: e, target: t, type: n, imageMap: r, errorHandler: o }) {
  return Jn(this, void 0, void 0, function* () {
    try {
      const i = function(l, c) {
        try {
          return c === Ua.WebGL ? l.getContext("webgl") || l.getContext("experimental-webgl") : l.getContext("webgl2");
        } catch {
          return null;
        }
      }(t, n);
      if (!i)
        return;
      if (e.setter)
        return void (i[e.property] = e.args[0]);
      const s = i[e.property], a = yield Promise.all(e.args.map(Yn(r, i)));
      (function(l, c) {
        if (!(c != null && c.constructor))
          return;
        const { name: u } = c.constructor;
        if (!OT.includes(u))
          return;
        const d = Ey(l, u);
        d.includes(c) || d.push(c);
      })(i, s.apply(i, a));
    } catch (i) {
      o(e, i);
    }
  });
}
function np({ event: e, mutation: t, target: n, imageMap: r, canvasEventMap: o, errorHandler: i }) {
  return Jn(this, void 0, void 0, function* () {
    try {
      const s = o.get(e) || t, a = "commands" in s ? s.commands : [s];
      if ([Ua.WebGL, Ua.WebGL2].includes(t.type)) {
        for (let l = 0; l < a.length; l++) {
          const c = a[l];
          yield AT({ mutation: c, type: t.type, target: n, imageMap: r, errorHandler: i });
        }
        return;
      }
      yield function({ event: l, mutations: c, target: u, imageMap: d, errorHandler: f }) {
        return Jn(this, void 0, void 0, function* () {
          const m = u.getContext("2d");
          if (!m)
            return void f(c[0], new Error("Canvas context is null"));
          const h = c.map((p) => Jn(this, void 0, void 0, function* () {
            return Promise.all(p.args.map(Yn(d, m)));
          }));
          (yield Promise.all(h)).forEach((p, g) => {
            const v = c[g];
            try {
              if (v.setter)
                return void (m[v.property] = v.args[0]);
              const y = m[v.property];
              v.property === "drawImage" && typeof v.args[0] == "string" ? (d.get(l), y.apply(m, v.args)) : y.apply(m, p);
            } catch (y) {
              f(v, y);
            }
          });
        });
      }({ event: e, mutations: a, target: n, imageMap: r, errorHandler: i });
    } catch (s) {
      i(t, s);
    }
  });
}
const DT = by || _T, tc = { duration: 500, lineCap: "round", lineWidth: 3, strokeStyle: "red" };
function rp(e) {
  return e.type == Ue.IncrementalSnapshot && (e.data.source == $e.TouchMove || e.data.source == $e.MouseInteraction && e.data.type == ct.TouchStart);
}
class MT {
  get timer() {
    return this.service.state.context.timer;
  }
  constructor(t, n) {
    if (this.usingVirtualDom = !1, this.virtualDom = new Yo(), this.mouseTail = null, this.tailPositions = [], this.emitter = DT(), this.legacy_missingNodeRetryMap = {}, this.cache = Hh(), this.imageMap = /* @__PURE__ */ new Map(), this.canvasEventMap = /* @__PURE__ */ new Map(), this.mirror = YN(), this.styleMirror = new eT(), this.firstFullSnapshot = null, this.newDocumentQueue = [], this.mousePos = null, this.touchActive = null, this.lastMouseDownEvent = null, this.lastSelectionData = null, this.constructedStyleMutations = [], this.adoptedStyleSheets = [], this.handleResize = (a) => {
      this.iframe.style.display = "inherit";
      for (const l of [this.mouseTail, this.iframe])
        l && (l.setAttribute("width", String(a.width)), l.setAttribute("height", String(a.height)));
    }, this.applyEventsSynchronously = (a) => {
      for (const l of a) {
        switch (l.type) {
          case Ue.DomContentLoaded:
          case Ue.Load:
          case Ue.Custom:
            continue;
          case Ue.FullSnapshot:
          case Ue.Meta:
          case Ue.Plugin:
          case Ue.IncrementalSnapshot:
        }
        this.getCastFn(l, !0)();
      }
    }, this.getCastFn = (a, l = !1) => {
      let c;
      switch (a.type) {
        case Ue.DomContentLoaded:
        case Ue.Load:
          break;
        case Ue.Custom:
          c = () => {
            this.emitter.emit(Be.CustomEvent, a);
          };
          break;
        case Ue.Meta:
          c = () => this.emitter.emit(Be.Resize, { width: a.data.width, height: a.data.height });
          break;
        case Ue.FullSnapshot:
          c = () => {
            var u;
            if (this.firstFullSnapshot) {
              if (this.firstFullSnapshot === a)
                return void (this.firstFullSnapshot = !0);
            } else
              this.firstFullSnapshot = !0;
            this.rebuildFullSnapshot(a, l), (u = this.iframe.contentWindow) === null || u === void 0 || u.scrollTo(a.data.initialOffset), this.styleMirror.reset();
          };
          break;
        case Ue.IncrementalSnapshot:
          c = () => {
            if (this.applyIncremental(a, l), !l && (a === this.nextUserInteractionEvent && (this.nextUserInteractionEvent = null, this.backToNormal()), this.config.skipInactive && !this.nextUserInteractionEvent)) {
              for (const u of this.service.state.context.events)
                if (!(u.timestamp <= a.timestamp) && this.isUserInteraction(u)) {
                  u.delay - a.delay > 1e4 * this.speedService.state.context.timer.speed && (this.nextUserInteractionEvent = u);
                  break;
                }
              if (this.nextUserInteractionEvent) {
                const u = this.nextUserInteractionEvent.delay - a.delay, d = { speed: Math.min(Math.round(u / 5e3), this.config.maxSpeed) };
                this.speedService.send({ type: "FAST_FORWARD", payload: d }), this.emitter.emit(Be.SkipStart, d);
              }
            }
          };
      }
      return () => {
        c && c();
        for (const d of this.config.plugins || [])
          d.handler && d.handler(a, l, { replayer: this });
        this.service.send({ type: "CAST_EVENT", payload: { event: a } });
        const u = this.service.state.context.events.length - 1;
        if (!this.config.liveMode && a === this.service.state.context.events[u]) {
          const d = () => {
            u < this.service.state.context.events.length - 1 || (this.backToNormal(), this.service.send("END"), this.emitter.emit(Be.Finish));
          };
          let f = 50;
          a.type === Ue.IncrementalSnapshot && a.data.source === $e.MouseMove && a.data.positions.length && (f += Math.max(0, -a.data.positions[0].timeOffset)), setTimeout(d, f);
        }
        this.emitter.emit(Be.EventCast, a);
      };
    }, !(n != null && n.liveMode) && t.length < 2)
      throw new Error("Replayer need at least 2 events.");
    const r = { speed: 1, maxSpeed: 360, root: document.body, loadTimeout: 0, skipInactive: !1, showWarning: !0, showDebug: !1, blockClass: "rr-block", liveMode: !1, insertStyleRules: [], triggerFocus: !0, UNSAFE_replayCanvas: !1, pauseAnimation: !0, mouseTail: tc, useVirtualDom: !0, logger: console };
    this.config = Object.assign({}, r, n), this.handleResize = this.handleResize.bind(this), this.getCastFn = this.getCastFn.bind(this), this.applyEventsSynchronously = this.applyEventsSynchronously.bind(this), this.emitter.on(Be.Resize, this.handleResize), this.setupDom();
    for (const a of this.config.plugins || [])
      a.getMirror && a.getMirror({ nodeMirror: this.mirror });
    this.emitter.on(Be.Flush, () => {
      if (this.usingVirtualDom) {
        const a = { mirror: this.mirror, applyCanvas: (l, c, u) => {
          np({ event: l, mutation: c, target: u, imageMap: this.imageMap, canvasEventMap: this.canvasEventMap, errorHandler: this.warnCanvasMutationFailed.bind(this) });
        }, applyInput: this.applyInput.bind(this), applyScroll: this.applyScroll.bind(this), applyStyleSheetMutation: (l, c) => {
          l.source === $e.StyleSheetRule ? this.applyStyleSheetRule(l, c) : l.source === $e.StyleDeclaration && this.applyStyleDeclaration(l, c);
        }, afterAppend: (l, c) => {
          for (const u of this.config.plugins || [])
            u.onBuild && u.onBuild(l, { id: c, replayer: this });
        } };
        if (this.iframe.contentDocument)
          try {
            Ka(this.iframe.contentDocument, this.virtualDom, a, this.virtualDom.mirror);
          } catch (l) {
            console.warn(l);
          }
        if (this.virtualDom.destroyTree(), this.usingVirtualDom = !1, Object.keys(this.legacy_missingNodeRetryMap).length)
          for (const l in this.legacy_missingNodeRetryMap)
            try {
              const c = this.legacy_missingNodeRetryMap[l], u = Ga(c.node, this.mirror, this.virtualDom.mirror);
              Ka(u, c.node, a, this.virtualDom.mirror), c.node = u;
            } catch (c) {
              this.warn(c);
            }
        this.constructedStyleMutations.forEach((l) => {
          this.applyStyleSheetMutation(l);
        }), this.constructedStyleMutations = [], this.adoptedStyleSheets.forEach((l) => {
          this.applyAdoptedStyleSheet(l);
        }), this.adoptedStyleSheets = [];
      }
      if (this.mousePos && (this.moveAndHover(this.mousePos.x, this.mousePos.y, this.mousePos.id, !0, this.mousePos.debugData), this.mousePos = null), this.touchActive === !0 ? this.mouse.classList.add("touch-active") : this.touchActive === !1 && this.mouse.classList.remove("touch-active"), this.touchActive = null, this.lastMouseDownEvent) {
        const [a, l] = this.lastMouseDownEvent;
        a.dispatchEvent(l);
      }
      this.lastMouseDownEvent = null, this.lastSelectionData && (this.applySelection(this.lastSelectionData), this.lastSelectionData = null);
    }), this.emitter.on(Be.PlayBack, () => {
      this.firstFullSnapshot = null, this.mirror.reset(), this.styleMirror.reset();
    });
    const o = new NT([], { speed: this.config.speed });
    this.service = TT({ events: t.map((a) => n && n.unpackFn ? n.unpackFn(a) : a).sort((a, l) => a.timestamp - l.timestamp), timer: o, timeOffset: 0, baselineTime: 0, lastPlayedEvent: null }, { getCastFn: this.getCastFn, applyEventsSynchronously: this.applyEventsSynchronously, emitter: this.emitter }), this.service.start(), this.service.subscribe((a) => {
      this.emitter.emit(Be.StateChange, { player: a });
    }), this.speedService = Sy(xy({ id: "speed", context: { normalSpeed: -1, timer: o }, initial: "normal", states: { normal: { on: { FAST_FORWARD: { target: "skipping", actions: ["recordSpeed", "setSpeed"] }, SET_SPEED: { target: "normal", actions: ["setSpeed"] } } }, skipping: { on: { BACK_TO_NORMAL: { target: "normal", actions: ["restoreSpeed"] }, SET_SPEED: { target: "normal", actions: ["setSpeed"] } } } } }, { actions: { setSpeed: (a, l) => {
      "payload" in l && a.timer.setSpeed(l.payload.speed);
    }, recordSpeed: ho({ normalSpeed: (a) => a.timer.speed }), restoreSpeed: (a) => {
      a.timer.setSpeed(a.normalSpeed);
    } } })), this.speedService.start(), this.speedService.subscribe((a) => {
      this.emitter.emit(Be.StateChange, { speed: a });
    });
    const i = this.service.state.context.events.find((a) => a.type === Ue.Meta), s = this.service.state.context.events.find((a) => a.type === Ue.FullSnapshot);
    if (i) {
      const { width: a, height: l } = i.data;
      setTimeout(() => {
        this.emitter.emit(Be.Resize, { width: a, height: l });
      }, 0);
    }
    s && setTimeout(() => {
      var a;
      this.firstFullSnapshot || (this.firstFullSnapshot = s, this.rebuildFullSnapshot(s), (a = this.iframe.contentWindow) === null || a === void 0 || a.scrollTo(s.data.initialOffset));
    }, 1), this.service.state.context.events.find(rp) && this.mouse.classList.add("touch-device");
  }
  on(t, n) {
    return this.emitter.on(t, n), this;
  }
  off(t, n) {
    return this.emitter.off(t, n), this;
  }
  setConfig(t) {
    Object.keys(t).forEach((n) => {
      t[n], this.config[n] = t[n];
    }), this.config.skipInactive || this.backToNormal(), t.speed !== void 0 && this.speedService.send({ type: "SET_SPEED", payload: { speed: t.speed } }), t.mouseTail !== void 0 && (t.mouseTail === !1 ? this.mouseTail && (this.mouseTail.style.display = "none") : (this.mouseTail || (this.mouseTail = document.createElement("canvas"), this.mouseTail.width = Number.parseFloat(this.iframe.width), this.mouseTail.height = Number.parseFloat(this.iframe.height), this.mouseTail.classList.add("replayer-mouse-tail"), this.wrapper.insertBefore(this.mouseTail, this.iframe)), this.mouseTail.style.display = "inherit"));
  }
  getMetaData() {
    const t = this.service.state.context.events[0], n = this.service.state.context.events[this.service.state.context.events.length - 1];
    return { startTime: t.timestamp, endTime: n.timestamp, totalTime: n.timestamp - t.timestamp };
  }
  getCurrentTime() {
    return this.timer.timeOffset + this.getTimeOffset();
  }
  getTimeOffset() {
    const { baselineTime: t, events: n } = this.service.state.context;
    return t - n[0].timestamp;
  }
  getMirror() {
    return this.mirror;
  }
  play(t = 0) {
    var n, r;
    this.service.state.matches("paused") || this.service.send({ type: "PAUSE" }), this.service.send({ type: "PLAY", payload: { timeOffset: t } }), (r = (n = this.iframe.contentDocument) === null || n === void 0 ? void 0 : n.getElementsByTagName("html")[0]) === null || r === void 0 || r.classList.remove("rrweb-paused"), this.emitter.emit(Be.Start);
  }
  pause(t) {
    var n, r;
    t === void 0 && this.service.state.matches("playing") && this.service.send({ type: "PAUSE" }), typeof t == "number" && (this.play(t), this.service.send({ type: "PAUSE" })), (r = (n = this.iframe.contentDocument) === null || n === void 0 ? void 0 : n.getElementsByTagName("html")[0]) === null || r === void 0 || r.classList.add("rrweb-paused"), this.emitter.emit(Be.Pause);
  }
  resume(t = 0) {
    this.warn("The 'resume' was deprecated in 1.0. Please use 'play' method which has the same interface."), this.play(t), this.emitter.emit(Be.Resume);
  }
  destroy() {
    this.pause(), this.config.root.removeChild(this.wrapper), this.emitter.emit(Be.Destroy);
  }
  startLive(t) {
    this.service.send({ type: "TO_LIVE", payload: { baselineTime: t } });
  }
  addEvent(t) {
    const n = this.config.unpackFn ? this.config.unpackFn(t) : t;
    rp(n) && this.mouse.classList.add("touch-device"), Promise.resolve().then(() => this.service.send({ type: "ADD_EVENT", payload: { event: n } }));
  }
  enableInteract() {
    this.iframe.setAttribute("scrolling", "auto"), this.iframe.style.pointerEvents = "auto";
  }
  disableInteract() {
    this.iframe.setAttribute("scrolling", "no"), this.iframe.style.pointerEvents = "none";
  }
  resetCache() {
    this.cache = Hh();
  }
  setupDom() {
    this.wrapper = document.createElement("div"), this.wrapper.classList.add("replayer-wrapper"), this.config.root.appendChild(this.wrapper), this.mouse = document.createElement("div"), this.mouse.classList.add("replayer-mouse"), this.wrapper.appendChild(this.mouse), this.config.mouseTail !== !1 && (this.mouseTail = document.createElement("canvas"), this.mouseTail.classList.add("replayer-mouse-tail"), this.mouseTail.style.display = "inherit", this.wrapper.appendChild(this.mouseTail)), this.iframe = document.createElement("iframe");
    const t = ["allow-same-origin"];
    this.config.UNSAFE_replayCanvas && t.push("allow-scripts"), this.iframe.style.display = "none", this.iframe.setAttribute("sandbox", t.join(" ")), this.disableInteract(), this.wrapper.appendChild(this.iframe), this.iframe.contentWindow && this.iframe.contentDocument && (IT(this.iframe.contentWindow, this.iframe.contentDocument), function(n = window) {
      "NodeList" in n && !n.NodeList.prototype.forEach && (n.NodeList.prototype.forEach = Array.prototype.forEach), "DOMTokenList" in n && !n.DOMTokenList.prototype.forEach && (n.DOMTokenList.prototype.forEach = Array.prototype.forEach), Node.prototype.contains || (Node.prototype.contains = (...r) => {
        let o = r[0];
        if (!(0 in r))
          throw new TypeError("1 argument is required");
        do
          if (this === o)
            return !0;
        while (o = o && o.parentNode);
        return !1;
      });
    }(this.iframe.contentWindow));
  }
  rebuildFullSnapshot(t, n = !1) {
    if (!this.iframe.contentDocument)
      return this.warn("Looks like your replayer has been destroyed.");
    Object.keys(this.legacy_missingNodeRetryMap).length && this.warn("Found unresolved missing node map", this.legacy_missingNodeRetryMap), this.legacy_missingNodeRetryMap = {};
    const r = [], o = (a, l) => {
      this.collectIframeAndAttachDocument(r, a);
      for (const c of this.config.plugins || [])
        c.onBuild && c.onBuild(a, { id: l, replayer: this });
    };
    this.usingVirtualDom && (this.virtualDom.destroyTree(), this.usingVirtualDom = !1), this.mirror.reset(), JN(t.data.node, { doc: this.iframe.contentDocument, afterAppend: o, cache: this.cache, mirror: this.mirror }), o(this.iframe.contentDocument, t.data.node.id);
    for (const { mutationInQueue: a, builtNode: l } of r)
      this.attachDocumentToIframe(a, l), this.newDocumentQueue = this.newDocumentQueue.filter((c) => c !== a);
    const { documentElement: i, head: s } = this.iframe.contentDocument;
    this.insertStyleRules(i, s), this.service.state.matches("playing") || this.iframe.contentDocument.getElementsByTagName("html")[0].classList.add("rrweb-paused"), this.emitter.emit(Be.FullsnapshotRebuilded, t), n || this.waitForStylesheetLoad(), this.config.UNSAFE_replayCanvas && this.preloadAllImages();
  }
  insertStyleRules(t, n) {
    var r;
    const o = (i = this.config.blockClass, [`.${i} { background: currentColor }`, "noscript { display: none !important; }"]).concat(this.config.insertStyleRules);
    var i;
    if (this.config.pauseAnimation && o.push("html.rrweb-paused *, html.rrweb-paused *:before, html.rrweb-paused *:after { animation-play-state: paused !important; }"), this.usingVirtualDom) {
      const s = this.virtualDom.createElement("style");
      this.virtualDom.mirror.add(s, dy(s, this.virtualDom.unserializedId)), t.insertBefore(s, n), s.rules.push({ source: $e.StyleSheetRule, adds: o.map((a, l) => ({ rule: a, index: l })) });
    } else {
      const s = document.createElement("style");
      t.insertBefore(s, n);
      for (let a = 0; a < o.length; a++)
        (r = s.sheet) === null || r === void 0 || r.insertRule(o[a], a);
    }
  }
  attachDocumentToIframe(t, n) {
    const r = this.usingVirtualDom ? this.virtualDom.mirror : this.mirror, o = [], i = (s, a) => {
      this.collectIframeAndAttachDocument(o, s);
      const l = r.getMeta(s);
      if ((l == null ? void 0 : l.type) === Le.Element && (l == null ? void 0 : l.tagName.toUpperCase()) === "HTML") {
        const { documentElement: c, head: u } = n.contentDocument;
        this.insertStyleRules(c, u);
      }
      if (!this.usingVirtualDom)
        for (const c of this.config.plugins || [])
          c.onBuild && c.onBuild(s, { id: a, replayer: this });
    };
    ki(t.node, { doc: n.contentDocument, mirror: r, hackCss: !0, skipChild: !1, afterAppend: i, cache: this.cache }), i(n.contentDocument, t.node.id);
    for (const { mutationInQueue: s, builtNode: a } of o)
      this.attachDocumentToIframe(s, a), this.newDocumentQueue = this.newDocumentQueue.filter((l) => l !== s);
  }
  collectIframeAndAttachDocument(t, n) {
    if (Zl(n, this.mirror)) {
      const r = this.newDocumentQueue.find((o) => o.parentId === this.mirror.getId(n));
      r && t.push({ mutationInQueue: r, builtNode: n });
    }
  }
  waitForStylesheetLoad() {
    var t;
    const n = (t = this.iframe.contentDocument) === null || t === void 0 ? void 0 : t.head;
    if (n) {
      const r = /* @__PURE__ */ new Set();
      let o, i = this.service.state;
      const s = () => {
        i = this.service.state;
      };
      this.emitter.on(Be.Start, s), this.emitter.on(Be.Pause, s);
      const a = () => {
        this.emitter.off(Be.Start, s), this.emitter.off(Be.Pause, s);
      };
      n.querySelectorAll('link[rel="stylesheet"]').forEach((l) => {
        l.sheet || (r.add(l), l.addEventListener("load", () => {
          r.delete(l), r.size === 0 && o !== -1 && (i.matches("playing") && this.play(this.getCurrentTime()), this.emitter.emit(Be.LoadStylesheetEnd), o && clearTimeout(o), a());
        }));
      }), r.size > 0 && (this.service.send({ type: "PAUSE" }), this.emitter.emit(Be.LoadStylesheetStart), o = setTimeout(() => {
        i.matches("playing") && this.play(this.getCurrentTime()), o = -1, a();
      }, this.config.loadTimeout));
    }
  }
  preloadAllImages() {
    return Jn(this, void 0, void 0, function* () {
      this.service.state;
      const t = () => {
        this.service.state;
      };
      this.emitter.on(Be.Start, t), this.emitter.on(Be.Pause, t);
      const n = [];
      for (const r of this.service.state.context.events)
        r.type === Ue.IncrementalSnapshot && r.data.source === $e.CanvasMutation && (n.push(this.deserializeAndPreloadCanvasEvents(r.data, r)), ("commands" in r.data ? r.data.commands : [r.data]).forEach((o) => {
          this.preloadImages(o, r);
        }));
      return Promise.all(n);
    });
  }
  preloadImages(t, n) {
    if (t.property === "drawImage" && typeof t.args[0] == "string" && !this.imageMap.has(n)) {
      const r = document.createElement("canvas"), o = r.getContext("2d"), i = o == null ? void 0 : o.createImageData(r.width, r.height);
      i == null || i.data, JSON.parse(t.args[0]), o == null || o.putImageData(i, 0, 0);
    }
  }
  deserializeAndPreloadCanvasEvents(t, n) {
    return Jn(this, void 0, void 0, function* () {
      if (!this.canvasEventMap.has(n)) {
        const r = { isUnchanged: !0 };
        if ("commands" in t) {
          const o = yield Promise.all(t.commands.map((i) => Jn(this, void 0, void 0, function* () {
            const s = yield Promise.all(i.args.map(Yn(this.imageMap, null, r)));
            return Object.assign(Object.assign({}, i), { args: s });
          })));
          r.isUnchanged === !1 && this.canvasEventMap.set(n, Object.assign(Object.assign({}, t), { commands: o }));
        } else {
          const o = yield Promise.all(t.args.map(Yn(this.imageMap, null, r)));
          r.isUnchanged === !1 && this.canvasEventMap.set(n, Object.assign(Object.assign({}, t), { args: o }));
        }
      }
    });
  }
  applyIncremental(t, n) {
    var r, o, i;
    const { data: s } = t;
    switch (s.source) {
      case $e.Mutation:
        try {
          this.applyMutation(s, n);
        } catch (a) {
          this.warn(`Exception in mutation ${a.message || a}`, s);
        }
        break;
      case $e.Drag:
      case $e.TouchMove:
      case $e.MouseMove:
        if (n) {
          const a = s.positions[s.positions.length - 1];
          this.mousePos = { x: a.x, y: a.y, id: a.id, debugData: s };
        } else
          s.positions.forEach((a) => {
            const l = { doAction: () => {
              this.moveAndHover(a.x, a.y, a.id, n, s);
            }, delay: a.timeOffset + t.timestamp - this.service.state.context.baselineTime };
            this.timer.addAction(l);
          }), this.timer.addAction({ doAction() {
          }, delay: t.delay - ((r = s.positions[0]) === null || r === void 0 ? void 0 : r.timeOffset) });
        break;
      case $e.MouseInteraction: {
        if (s.id === -1)
          break;
        const a = new Event(ct[s.type].toLowerCase()), l = this.mirror.getNode(s.id);
        if (!l)
          return this.debugNodeNotFound(s, s.id);
        this.emitter.emit(Be.MouseInteraction, { type: s.type, target: l });
        const { triggerFocus: c } = this.config;
        switch (s.type) {
          case ct.Blur:
            "blur" in l && l.blur();
            break;
          case ct.Focus:
            c && l.focus && l.focus({ preventScroll: !0 });
            break;
          case ct.Click:
          case ct.TouchStart:
          case ct.TouchEnd:
          case ct.MouseDown:
          case ct.MouseUp:
            n ? (s.type === ct.TouchStart ? this.touchActive = !0 : s.type === ct.TouchEnd && (this.touchActive = !1), s.type === ct.MouseDown ? this.lastMouseDownEvent = [l, a] : s.type === ct.MouseUp && (this.lastMouseDownEvent = null), this.mousePos = { x: s.x, y: s.y, id: s.id, debugData: s }) : (s.type === ct.TouchStart && (this.tailPositions.length = 0), this.moveAndHover(s.x, s.y, s.id, n, s), s.type === ct.Click ? (this.mouse.classList.remove("active"), this.mouse.offsetWidth, this.mouse.classList.add("active")) : s.type === ct.TouchStart ? (this.mouse.offsetWidth, this.mouse.classList.add("touch-active")) : s.type === ct.TouchEnd ? this.mouse.classList.remove("touch-active") : l.dispatchEvent(a));
            break;
          case ct.TouchCancel:
            n ? this.touchActive = !1 : this.mouse.classList.remove("touch-active");
            break;
          default:
            l.dispatchEvent(a);
        }
        break;
      }
      case $e.Scroll:
        if (s.id === -1)
          break;
        if (this.usingVirtualDom) {
          const a = this.virtualDom.mirror.getNode(s.id);
          if (!a)
            return this.debugNodeNotFound(s, s.id);
          a.scrollData = s;
          break;
        }
        this.applyScroll(s, n);
        break;
      case $e.ViewportResize:
        this.emitter.emit(Be.Resize, { width: s.width, height: s.height });
        break;
      case $e.Input:
        if (s.id === -1)
          break;
        if (this.usingVirtualDom) {
          const a = this.virtualDom.mirror.getNode(s.id);
          if (!a)
            return this.debugNodeNotFound(s, s.id);
          a.inputData = s;
          break;
        }
        this.applyInput(s);
        break;
      case $e.MediaInteraction: {
        const a = this.usingVirtualDom ? this.virtualDom.mirror.getNode(s.id) : this.mirror.getNode(s.id);
        if (!a)
          return this.debugNodeNotFound(s, s.id);
        const l = a;
        try {
          s.currentTime !== void 0 && (l.currentTime = s.currentTime), s.volume !== void 0 && (l.volume = s.volume), s.muted !== void 0 && (l.muted = s.muted), s.type === 1 && l.pause(), s.type === 0 && l.play(), s.type === 4 && (l.playbackRate = s.playbackRate);
        } catch (c) {
          this.warn(`Failed to replay media interactions: ${c.message || c}`);
        }
        break;
      }
      case $e.StyleSheetRule:
      case $e.StyleDeclaration:
        this.usingVirtualDom ? s.styleId ? this.constructedStyleMutations.push(s) : s.id && ((o = this.virtualDom.mirror.getNode(s.id)) === null || o === void 0 || o.rules.push(s)) : this.applyStyleSheetMutation(s);
        break;
      case $e.CanvasMutation:
        if (!this.config.UNSAFE_replayCanvas)
          return;
        if (this.usingVirtualDom) {
          const a = this.virtualDom.mirror.getNode(s.id);
          if (!a)
            return this.debugNodeNotFound(s, s.id);
          a.canvasMutations.push({ event: t, mutation: s });
        } else {
          const a = this.mirror.getNode(s.id);
          if (!a)
            return this.debugNodeNotFound(s, s.id);
          np({ event: t, mutation: s, target: a, imageMap: this.imageMap, canvasEventMap: this.canvasEventMap, errorHandler: this.warnCanvasMutationFailed.bind(this) });
        }
        break;
      case $e.Font:
        try {
          const a = new FontFace(s.family, s.buffer ? new Uint8Array(JSON.parse(s.fontSource)) : s.fontSource, s.descriptors);
          (i = this.iframe.contentDocument) === null || i === void 0 || i.fonts.add(a);
        } catch (a) {
          this.warn(a);
        }
        break;
      case $e.Selection:
        if (n) {
          this.lastSelectionData = s;
          break;
        }
        this.applySelection(s);
        break;
      case $e.AdoptedStyleSheet:
        this.usingVirtualDom ? this.adoptedStyleSheets.push(s) : this.applyAdoptedStyleSheet(s);
    }
  }
  applyMutation(t, n) {
    if (this.config.useVirtualDom && !this.usingVirtualDom && n && (this.usingVirtualDom = !0, gT(this.iframe.contentDocument, this.mirror, this.virtualDom), Object.keys(this.legacy_missingNodeRetryMap).length))
      for (const l in this.legacy_missingNodeRetryMap)
        try {
          const c = this.legacy_missingNodeRetryMap[l], u = uy(c.node, this.virtualDom, this.mirror);
          u && (c.node = u);
        } catch (c) {
          this.warn(c);
        }
    const r = this.usingVirtualDom ? this.virtualDom.mirror : this.mirror;
    t.removes = t.removes.filter((l) => !!r.getNode(l.id) || (this.warnNodeNotFound(t, l.id), !1)), t.removes.forEach((l) => {
      var c;
      const u = r.getNode(l.id);
      if (!u)
        return;
      let d = r.getNode(l.parentId);
      if (!d)
        return this.warnNodeNotFound(t, l.parentId);
      if (l.isShadow && Xs(d) && (d = d.shadowRoot), r.removeNodeFromMap(u), d)
        try {
          d.removeChild(u), this.usingVirtualDom && u.nodeName === "#text" && d.nodeName === "STYLE" && ((c = d.rules) === null || c === void 0 ? void 0 : c.length) > 0 && (d.rules = []);
        } catch (f) {
          if (!(f instanceof DOMException))
            throw f;
          this.warn("parent could not remove child in mutation", d, u, t);
        }
    });
    const o = Object.assign({}, this.legacy_missingNodeRetryMap), i = [], s = (l) => {
      var c, u;
      if (!this.iframe.contentDocument)
        return this.warn("Looks like your replayer has been destroyed.");
      let d = r.getNode(l.parentId);
      if (!d)
        return l.node.type === Le.Document ? this.newDocumentQueue.push(l) : i.push(l);
      l.node.isShadow && (Xs(d) || d.attachShadow({ mode: "open" }), d = d.shadowRoot);
      let f = null, m = null;
      if (l.previousId && (f = r.getNode(l.previousId)), l.nextId && (m = r.getNode(l.nextId)), ((y) => {
        let b = null;
        return y.nextId && (b = r.getNode(y.nextId)), y.nextId !== null && y.nextId !== void 0 && y.nextId !== -1 && !b;
      })(l))
        return i.push(l);
      if (l.node.rootId && !r.getNode(l.node.rootId))
        return;
      const h = l.node.rootId ? r.getNode(l.node.rootId) : this.usingVirtualDom ? this.virtualDom : this.iframe.contentDocument;
      if (Zl(d, r))
        return void this.attachDocumentToIframe(l, d);
      const p = (y, b) => {
        if (!this.usingVirtualDom)
          for (const E of this.config.plugins || [])
            E.onBuild && E.onBuild(y, { id: b, replayer: this });
      }, g = ki(l.node, { doc: h, mirror: r, skipChild: !0, hackCss: !0, cache: this.cache, afterAppend: p });
      if (l.previousId === -1 || l.nextId === -1)
        return void (o[l.node.id] = { node: g, mutation: l });
      const v = r.getMeta(d);
      if (v && v.type === Le.Element && v.tagName === "textarea" && l.node.type === Le.Text) {
        const y = Array.isArray(d.childNodes) ? d.childNodes : Array.from(d.childNodes);
        for (const b of y)
          b.nodeType === d.TEXT_NODE && d.removeChild(b);
      } else if ((v == null ? void 0 : v.type) === Le.Document) {
        const y = d;
        l.node.type === Le.DocumentType && ((c = y.childNodes[0]) === null || c === void 0 ? void 0 : c.nodeType) === Node.DOCUMENT_TYPE_NODE && y.removeChild(y.childNodes[0]), g.nodeName === "HTML" && y.documentElement && y.removeChild(y.documentElement);
      }
      if (f && f.nextSibling && f.nextSibling.parentNode ? d.insertBefore(g, f.nextSibling) : m && m.parentNode ? d.contains(m) ? d.insertBefore(g, m) : d.insertBefore(g, null) : d.appendChild(g), p(g, l.node.id), this.usingVirtualDom && g.nodeName === "#text" && d.nodeName === "STYLE" && ((u = d.rules) === null || u === void 0 ? void 0 : u.length) > 0 && (d.rules = []), Zl(g, this.mirror)) {
        const y = this.mirror.getId(g), b = this.newDocumentQueue.find((E) => E.parentId === y);
        b && (this.attachDocumentToIframe(b, g), this.newDocumentQueue = this.newDocumentQueue.filter((E) => E !== b));
      }
      (l.previousId || l.nextId) && this.legacy_resolveMissingNode(o, d, g, l);
    };
    t.adds.forEach((l) => {
      s(l);
    });
    const a = Date.now();
    for (; i.length; ) {
      const l = QN(i);
      if (i.length = 0, Date.now() - a > 500) {
        this.warn("Timeout in the loop, please check the resolve tree data:", l);
        break;
      }
      for (const c of l)
        r.getNode(c.value.parentId) ? ey(c, (u) => {
          s(u);
        }) : this.debug("Drop resolve tree since there is no parent for the root node.", c);
    }
    Object.keys(o).length && Object.assign(this.legacy_missingNodeRetryMap, o), function(l) {
      const c = /* @__PURE__ */ new Set(), u = [];
      for (let d = l.length; d--; ) {
        const f = l[d];
        c.has(f.id) || (u.push(f), c.add(f.id));
      }
      return u;
    }(t.texts).forEach((l) => {
      var c;
      const u = r.getNode(l.id);
      if (!u)
        return t.removes.find((d) => d.id === l.id) ? void 0 : this.warnNodeNotFound(t, l.id);
      if (u.textContent = l.value, this.usingVirtualDom) {
        const d = u.parentNode;
        ((c = d == null ? void 0 : d.rules) === null || c === void 0 ? void 0 : c.length) > 0 && (d.rules = []);
      }
    }), t.attributes.forEach((l) => {
      const c = r.getNode(l.id);
      if (!c)
        return t.removes.find((u) => u.id === l.id) ? void 0 : this.warnNodeNotFound(t, l.id);
      for (const u in l.attributes)
        if (typeof u == "string") {
          const d = l.attributes[u];
          if (d === null)
            c.removeAttribute(u);
          else if (typeof d == "string")
            try {
              if (u === "_cssText" && (c.nodeName === "LINK" || c.nodeName === "STYLE"))
                try {
                  const f = r.getMeta(c);
                  Object.assign(f.attributes, l.attributes);
                  const m = ki(f, { doc: c.ownerDocument, mirror: r, skipChild: !0, hackCss: !0, cache: this.cache }), h = c.nextSibling, p = c.parentNode;
                  if (m && p) {
                    p.removeChild(c), p.insertBefore(m, h), r.replace(l.id, m);
                    break;
                  }
                } catch {
                }
              c.setAttribute(u, d);
            } catch (f) {
              this.warn("An error occurred may due to the checkout feature.", f);
            }
          else if (u === "style") {
            const f = d, m = c;
            for (const h in f)
              if (f[h] === !1)
                m.style.removeProperty(h);
              else if (f[h] instanceof Array) {
                const p = f[h];
                m.style.setProperty(h, p[0], p[1]);
              } else {
                const p = f[h];
                m.style.setProperty(h, p);
              }
          }
        }
    });
  }
  applyScroll(t, n) {
    var r, o;
    const i = this.mirror.getNode(t.id);
    if (!i)
      return this.debugNodeNotFound(t, t.id);
    const s = this.mirror.getMeta(i);
    if (i === this.iframe.contentDocument)
      (r = this.iframe.contentWindow) === null || r === void 0 || r.scrollTo({ top: t.y, left: t.x, behavior: n ? "auto" : "smooth" });
    else if ((s == null ? void 0 : s.type) === Le.Document)
      (o = i.defaultView) === null || o === void 0 || o.scrollTo({ top: t.y, left: t.x, behavior: n ? "auto" : "smooth" });
    else
      try {
        i.scrollTo({ top: t.y, left: t.x, behavior: n ? "auto" : "smooth" });
      } catch {
      }
  }
  applyInput(t) {
    const n = this.mirror.getNode(t.id);
    if (!n)
      return this.debugNodeNotFound(t, t.id);
    try {
      n.checked = t.isChecked, n.value = t.text;
    } catch {
    }
  }
  applySelection(t) {
    try {
      const n = /* @__PURE__ */ new Set(), r = t.ranges.map(({ start: o, startOffset: i, end: s, endOffset: a }) => {
        const l = this.mirror.getNode(o), c = this.mirror.getNode(s);
        if (!l || !c)
          return;
        const u = new Range();
        u.setStart(l, i), u.setEnd(c, a);
        const d = l.ownerDocument, f = d == null ? void 0 : d.getSelection();
        return f && n.add(f), { range: u, selection: f };
      });
      n.forEach((o) => o.removeAllRanges()), r.forEach((o) => {
        var i;
        return o && ((i = o.selection) === null || i === void 0 ? void 0 : i.addRange(o.range));
      });
    } catch {
    }
  }
  applyStyleSheetMutation(t) {
    var n;
    let r = null;
    t.styleId ? r = this.styleMirror.getStyle(t.styleId) : t.id && (r = ((n = this.mirror.getNode(t.id)) === null || n === void 0 ? void 0 : n.sheet) || null), r && (t.source === $e.StyleSheetRule ? this.applyStyleSheetRule(t, r) : t.source === $e.StyleDeclaration && this.applyStyleDeclaration(t, r));
  }
  applyStyleSheetRule(t, n) {
    var r, o, i, s;
    if ((r = t.adds) === null || r === void 0 || r.forEach(({ rule: a, index: l }) => {
      try {
        if (Array.isArray(l)) {
          const { positions: c, index: u } = Uh(l);
          mi(n.cssRules, c).insertRule(a, u);
        } else {
          const c = l === void 0 ? void 0 : Math.min(l, n.cssRules.length);
          n == null || n.insertRule(a, c);
        }
      } catch {
      }
    }), (o = t.removes) === null || o === void 0 || o.forEach(({ index: a }) => {
      try {
        if (Array.isArray(a)) {
          const { positions: l, index: c } = Uh(a);
          mi(n.cssRules, l).deleteRule(c || 0);
        } else
          n == null || n.deleteRule(a);
      } catch {
      }
    }), t.replace)
      try {
        (i = n.replace) === null || i === void 0 || i.call(n, t.replace);
      } catch {
      }
    if (t.replaceSync)
      try {
        (s = n.replaceSync) === null || s === void 0 || s.call(n, t.replaceSync);
      } catch {
      }
  }
  applyStyleDeclaration(t, n) {
    t.set && mi(n.rules, t.index).style.setProperty(t.set.property, t.set.value, t.set.priority), t.remove && mi(n.rules, t.index).style.removeProperty(t.remove.property);
  }
  applyAdoptedStyleSheet(t) {
    var n;
    const r = this.mirror.getNode(t.id);
    if (!r)
      return;
    (n = t.styles) === null || n === void 0 || n.forEach((s) => {
      var a;
      let l = null, c = null;
      if (Xs(r) ? c = ((a = r.ownerDocument) === null || a === void 0 ? void 0 : a.defaultView) || null : r.nodeName === "#document" && (c = r.defaultView), c)
        try {
          l = new c.CSSStyleSheet(), this.styleMirror.add(l, s.styleId), this.applyStyleSheetRule({ source: $e.StyleSheetRule, adds: s.rules }, l);
        } catch {
        }
    });
    let o = 0;
    const i = (s, a) => {
      const l = a.map((c) => this.styleMirror.getStyle(c)).filter((c) => c !== null);
      Xs(s) ? s.shadowRoot.adoptedStyleSheets = l : s.nodeName === "#document" && (s.adoptedStyleSheets = l), l.length !== a.length && o < 10 && (setTimeout(() => i(s, a), 0 + 100 * o), o++);
    };
    i(r, t.styleIds);
  }
  legacy_resolveMissingNode(t, n, r, o) {
    const { previousId: i, nextId: s } = o, a = i && t[i], l = s && t[s];
    if (a) {
      const { node: c, mutation: u } = a;
      n.insertBefore(c, r), delete t[u.node.id], delete this.legacy_missingNodeRetryMap[u.node.id], (u.previousId || u.nextId) && this.legacy_resolveMissingNode(t, n, c, u);
    }
    if (l) {
      const { node: c, mutation: u } = l;
      n.insertBefore(c, r.nextSibling), delete t[u.node.id], delete this.legacy_missingNodeRetryMap[u.node.id], (u.previousId || u.nextId) && this.legacy_resolveMissingNode(t, n, c, u);
    }
  }
  moveAndHover(t, n, r, o, i) {
    const s = this.mirror.getNode(r);
    if (!s)
      return this.debugNodeNotFound(i, r);
    const a = ty(s, this.iframe), l = t * a.absoluteScale + a.x, c = n * a.absoluteScale + a.y;
    this.mouse.style.left = `${l}px`, this.mouse.style.top = `${c}px`, o || this.drawMouseTail({ x: l, y: c }), this.hoverElements(s);
  }
  drawMouseTail(t) {
    if (!this.mouseTail)
      return;
    const { lineCap: n, lineWidth: r, strokeStyle: o, duration: i } = this.config.mouseTail === !0 ? tc : Object.assign({}, tc, this.config.mouseTail), s = () => {
      if (!this.mouseTail)
        return;
      const a = this.mouseTail.getContext("2d");
      a && this.tailPositions.length && (a.clearRect(0, 0, this.mouseTail.width, this.mouseTail.height), a.beginPath(), a.lineWidth = r, a.lineCap = n, a.strokeStyle = o, a.moveTo(this.tailPositions[0].x, this.tailPositions[0].y), this.tailPositions.forEach((l) => a.lineTo(l.x, l.y)), a.stroke());
    };
    this.tailPositions.push(t), s(), setTimeout(() => {
      this.tailPositions = this.tailPositions.filter((a) => a !== t), s();
    }, i / this.speedService.state.context.timer.speed);
  }
  hoverElements(t) {
    var n;
    (n = this.lastHoveredRootNode || this.iframe.contentDocument) === null || n === void 0 || n.querySelectorAll(".\\:hover").forEach((o) => {
      o.classList.remove(":hover");
    }), this.lastHoveredRootNode = t.getRootNode();
    let r = t;
    for (; r; )
      r.classList && r.classList.add(":hover"), r = r.parentElement;
  }
  isUserInteraction(t) {
    return t.type === Ue.IncrementalSnapshot && t.data.source > $e.Mutation && t.data.source <= $e.Input;
  }
  backToNormal() {
    this.nextUserInteractionEvent = null, this.speedService.state.matches("normal") || (this.speedService.send({ type: "BACK_TO_NORMAL" }), this.emitter.emit(Be.SkipEnd, { speed: this.speedService.state.context.normalSpeed }));
  }
  warnNodeNotFound(t, n) {
    this.warn(`Node with id '${n}' not found. `, t);
  }
  warnCanvasMutationFailed(t, n) {
    this.warn("Has error on canvas update", n, "canvas mutation:", t);
  }
  debugNodeNotFound(t, n) {
    this.debug(`Node with id '${n}' not found. `, t);
  }
  warn(...t) {
    this.config.showWarning && this.config.logger.warn("[replayer]", ...t);
  }
  debug(...t) {
    this.config.showDebug && this.config.logger.log("[replayer]", ...t);
  }
}
function op(e) {
  let t = "";
  return Object.keys(e).forEach((n) => {
    t += `${n}: ${e[n]};`;
  }), t;
}
function ii(e, t = 2) {
  let n = String(e);
  const r = Math.pow(10, t - 1);
  if (e < r)
    for (; String(r).length > n.length; )
      n = `0${e}`;
  return n;
}
function Qs(e) {
  if (e <= 0)
    return "00:00";
  const t = Math.floor(e / 36e5);
  e %= 36e5;
  const n = Math.floor(e / 6e4);
  e %= 6e4;
  const r = Math.floor(e / 1e3);
  return t ? `${ii(t)}:${ii(n)}:${ii(r)}` : `${ii(n)}:${ii(r)}`;
}
function ip() {
  let e = !1;
  return ["fullscreen", "webkitIsFullScreen", "mozFullScreen", "msFullscreenElement"].forEach((t) => {
    t in document && (e = e || !!document[t]);
  }), e;
}
function sp(e) {
  return { "[object Boolean]": "boolean", "[object Number]": "number", "[object String]": "string", "[object Function]": "function", "[object Array]": "array", "[object Date]": "date", "[object RegExp]": "regExp", "[object Undefined]": "undefined", "[object Null]": "null", "[object Object]": "object" }[Object.prototype.toString.call(e)];
}
function $T(e) {
  return e.type === Ue.IncrementalSnapshot && e.data.source > $e.Mutation && e.data.source <= $e.Input;
}
function kT(e) {
  let t, n, r, o, i, s, a, l, c;
  return { c() {
    t = ut("div"), n = ut("input"), r = Ht(), o = ut("label"), i = Ht(), s = ut("span"), a = Ur(e[3]), Ce(n, "type", "checkbox"), Ce(n, "id", e[2]), n.disabled = e[1], Ce(n, "class", "svelte-9brlez"), Ce(o, "for", e[2]), Ce(o, "class", "svelte-9brlez"), Ce(s, "class", "label svelte-9brlez"), Ce(t, "class", "switch svelte-9brlez"), Po(t, "disabled", e[1]);
  }, m(u, d) {
    $n(u, t, d), Re(t, n), n.checked = e[0], Re(t, r), Re(t, o), Re(t, i), Re(t, s), Re(s, a), l || (c = Mi(n, "change", e[4]), l = !0);
  }, p(u, [d]) {
    4 & d && Ce(n, "id", u[2]), 2 & d && (n.disabled = u[1]), 1 & d && (n.checked = u[0]), 4 & d && Ce(o, "for", u[2]), 8 & d && Wa(a, u[3]), 2 & d && Po(t, "disabled", u[1]);
  }, i: os, o: os, d(u) {
    u && hn(t), l = !1, c();
  } };
}
function RT(e, t, n) {
  let { disabled: r } = t, { checked: o } = t, { id: i } = t, { label: s } = t;
  return e.$$set = (a) => {
    "disabled" in a && n(1, r = a.disabled), "checked" in a && n(0, o = a.checked), "id" in a && n(2, i = a.id), "label" in a && n(3, s = a.label);
  }, [o, r, i, s, function() {
    o = this.checked, n(0, o);
  }];
}
class PT extends md {
  constructor(t) {
    super(), pd(this, t, RT, kT, dd, { disabled: 1, checked: 0, id: 2, label: 3 });
  }
}
function ap(e, t, n) {
  const r = e.slice();
  return r[39] = t[n], r;
}
function lp(e, t, n) {
  const r = e.slice();
  return r[42] = t[n], r;
}
function cp(e, t, n) {
  const r = e.slice();
  return r[45] = t[n], r;
}
function up(e) {
  let t, n, r, o, i, s, a, l, c, u, d, f, m, h, p, g, v, y, b, E, S, T, C, _, w, R, O = Qs(e[6]) + "", I = Qs(e[8].totalTime) + "", L = e[14], D = [];
  for (let z = 0; z < L.length; z += 1)
    D[z] = dp(cp(e, L, z));
  let P = e[9], k = [];
  for (let z = 0; z < P.length; z += 1)
    k[z] = fp(lp(e, P, z));
  function N(z, le) {
    return z[7] === "playing" ? BT : FT;
  }
  let $ = N(e), B = $(e), U = e[3], J = [];
  for (let z = 0; z < U.length; z += 1)
    J[z] = hp(ap(e, U, z));
  function te(z) {
    e[30](z);
  }
  let ie = { id: "skip", disabled: e[10] === "skipping", label: "skip inactive" };
  return e[0] !== void 0 && (ie.checked = e[0]), E = new PT({ props: ie }), Xn.push(() => function(z, le, j) {
    const pe = z.$$.props[le];
    pe !== void 0 && (z.$$.bound[pe] = j, j(z.$$.ctx[pe]));
  }(E, "checked", te)), { c() {
    t = ut("div"), n = ut("div"), r = ut("span"), o = Ur(O), i = Ht(), s = ut("div"), a = ut("div"), l = Ht();
    for (let z = 0; z < D.length; z += 1)
      D[z].c();
    c = Ht();
    for (let z = 0; z < k.length; z += 1)
      k[z].c();
    u = Ht(), d = ut("div"), f = Ht(), m = ut("span"), h = Ur(I), p = Ht(), g = ut("div"), v = ut("button"), B.c(), y = Ht();
    for (let z = 0; z < J.length; z += 1)
      J[z].c();
    b = Ht(), Xv(E.$$.fragment), T = Ht(), C = ut("button"), C.innerHTML = `<svg class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="16" height="16"><defs><style type="text/css"></style></defs><path d="M916 380c-26.4 0-48-21.6-48-48L868 223.2 613.6 477.6c-18.4
            18.4-48.8 18.4-68 0-18.4-18.4-18.4-48.8 0-68L800 156 692 156c-26.4
            0-48-21.6-48-48 0-26.4 21.6-48 48-48l224 0c26.4 0 48 21.6 48 48l0
            224C964 358.4 942.4 380 916 380zM231.2 860l108.8 0c26.4 0 48 21.6 48
            48s-21.6 48-48 48l-224 0c-26.4 0-48-21.6-48-48l0-224c0-26.4 21.6-48
            48-48 26.4 0 48 21.6 48 48L164 792l253.6-253.6c18.4-18.4 48.8-18.4
            68 0 18.4 18.4 18.4 48.8 0 68L231.2 860z" p-id="1286"></path></svg>`, Ce(r, "class", "rr-timeline__time svelte-19ke1iv"), Ce(a, "class", "rr-progress__step svelte-19ke1iv"), ot(a, "width", e[13]), Ce(d, "class", "rr-progress__handler svelte-19ke1iv"), ot(d, "left", e[13]), Ce(s, "class", "rr-progress svelte-19ke1iv"), Po(s, "disabled", e[10] === "skipping"), Ce(m, "class", "rr-timeline__time svelte-19ke1iv"), Ce(n, "class", "rr-timeline svelte-19ke1iv"), Ce(v, "class", "svelte-19ke1iv"), Ce(C, "class", "svelte-19ke1iv"), Ce(g, "class", "rr-controller__btns svelte-19ke1iv"), Ce(t, "class", "rr-controller svelte-19ke1iv");
  }, m(z, le) {
    $n(z, t, le), Re(t, n), Re(n, r), Re(r, o), Re(n, i), Re(n, s), Re(s, a), e[27](a), Re(s, l);
    for (let j = 0; j < D.length; j += 1)
      D[j] && D[j].m(s, null);
    Re(s, c);
    for (let j = 0; j < k.length; j += 1)
      k[j] && k[j].m(s, null);
    Re(s, u), Re(s, d), e[28](s), Re(n, f), Re(n, m), Re(m, h), Re(t, p), Re(t, g), Re(g, v), B.m(v, null), Re(g, y);
    for (let j = 0; j < J.length; j += 1)
      J[j] && J[j].m(g, null);
    Re(g, b), fd(E, g, null), Re(g, T), Re(g, C), _ = !0, w || (R = [Mi(s, "click", e[16]), Mi(v, "click", e[4]), Mi(C, "click", e[31])], w = !0);
  }, p(z, le) {
    if ((!_ || 64 & le[0]) && O !== (O = Qs(z[6]) + "") && Wa(o, O), (!_ || 8192 & le[0]) && ot(a, "width", z[13]), 16384 & le[0]) {
      let ne;
      for (L = z[14], ne = 0; ne < L.length; ne += 1) {
        const ee = cp(z, L, ne);
        D[ne] ? D[ne].p(ee, le) : (D[ne] = dp(ee), D[ne].c(), D[ne].m(s, c));
      }
      for (; ne < D.length; ne += 1)
        D[ne].d(1);
      D.length = L.length;
    }
    if (512 & le[0]) {
      let ne;
      for (P = z[9], ne = 0; ne < P.length; ne += 1) {
        const ee = lp(z, P, ne);
        k[ne] ? k[ne].p(ee, le) : (k[ne] = fp(ee), k[ne].c(), k[ne].m(s, u));
      }
      for (; ne < k.length; ne += 1)
        k[ne].d(1);
      k.length = P.length;
    }
    if ((!_ || 8192 & le[0]) && ot(d, "left", z[13]), (!_ || 1024 & le[0]) && Po(s, "disabled", z[10] === "skipping"), (!_ || 256 & le[0]) && I !== (I = Qs(z[8].totalTime) + "") && Wa(h, I), $ !== ($ = N(z)) && (B.d(1), B = $(z), B && (B.c(), B.m(v, null))), 1066 & le[0]) {
      let ne;
      for (U = z[3], ne = 0; ne < U.length; ne += 1) {
        const ee = ap(z, U, ne);
        J[ne] ? J[ne].p(ee, le) : (J[ne] = hp(ee), J[ne].c(), J[ne].m(g, b));
      }
      for (; ne < J.length; ne += 1)
        J[ne].d(1);
      J.length = U.length;
    }
    const j = {};
    var pe;
    1024 & le[0] && (j.disabled = z[10] === "skipping"), !S && 1 & le[0] && (S = !0, j.checked = z[0], pe = () => S = !1, cu.push(pe)), E.$set(j);
  }, i(z) {
    _ || (Tn(E.$$.fragment, z), _ = !0);
  }, o(z) {
    Fo(E.$$.fragment, z), _ = !1;
  }, d(z) {
    z && hn(t), e[27](null), Yl(D, z), Yl(k, z), e[28](null), B.d(), Yl(J, z), hd(E), w = !1, Go(R);
  } };
}
function dp(e) {
  let t, n;
  return { c() {
    t = ut("div"), Ce(t, "title", n = e[45].name), ot(t, "width", e[45].width), ot(t, "height", "4px"), ot(t, "position", "absolute"), ot(t, "background", e[45].background), ot(t, "left", e[45].position);
  }, m(r, o) {
    $n(r, t, o);
  }, p(r, o) {
    16384 & o[0] && n !== (n = r[45].name) && Ce(t, "title", n), 16384 & o[0] && ot(t, "width", r[45].width), 16384 & o[0] && ot(t, "background", r[45].background), 16384 & o[0] && ot(t, "left", r[45].position);
  }, d(r) {
    r && hn(t);
  } };
}
function fp(e) {
  let t, n;
  return { c() {
    t = ut("div"), Ce(t, "title", n = e[42].name), ot(t, "width", "10px"), ot(t, "height", "5px"), ot(t, "position", "absolute"), ot(t, "top", "2px"), ot(t, "transform", "translate(-50%, -50%)"), ot(t, "background", e[42].background), ot(t, "left", e[42].position);
  }, m(r, o) {
    $n(r, t, o);
  }, p(r, o) {
    512 & o[0] && n !== (n = r[42].name) && Ce(t, "title", n), 512 & o[0] && ot(t, "background", r[42].background), 512 & o[0] && ot(t, "left", r[42].position);
  }, d(r) {
    r && hn(t);
  } };
}
function FT(e) {
  let t, n;
  return { c() {
    t = Ha("svg"), n = Ha("path"), Ce(n, "d", `M170.65984 896l0-768 640 384zM644.66944
              512l-388.66944-233.32864 0 466.65728z`), Ce(t, "class", "icon"), Ce(t, "viewBox", "0 0 1024 1024"), Ce(t, "version", "1.1"), Ce(t, "xmlns", "http://www.w3.org/2000/svg"), Ce(t, "xmlns:xlink", "http://www.w3.org/1999/xlink"), Ce(t, "width", "16"), Ce(t, "height", "16");
  }, m(r, o) {
    $n(r, t, o), Re(t, n);
  }, d(r) {
    r && hn(t);
  } };
}
function BT(e) {
  let t, n;
  return { c() {
    t = Ha("svg"), n = Ha("path"), Ce(n, "d", `M682.65984 128q53.00224 0 90.50112 37.49888t37.49888 90.50112l0
              512q0 53.00224-37.49888 90.50112t-90.50112
              37.49888-90.50112-37.49888-37.49888-90.50112l0-512q0-53.00224
              37.49888-90.50112t90.50112-37.49888zM341.34016 128q53.00224 0
              90.50112 37.49888t37.49888 90.50112l0 512q0 53.00224-37.49888
              90.50112t-90.50112
              37.49888-90.50112-37.49888-37.49888-90.50112l0-512q0-53.00224
              37.49888-90.50112t90.50112-37.49888zM341.34016 213.34016q-17.67424
              0-30.16704 12.4928t-12.4928 30.16704l0 512q0 17.67424 12.4928
              30.16704t30.16704 12.4928 30.16704-12.4928
              12.4928-30.16704l0-512q0-17.67424-12.4928-30.16704t-30.16704-12.4928zM682.65984
              213.34016q-17.67424 0-30.16704 12.4928t-12.4928 30.16704l0 512q0
              17.67424 12.4928 30.16704t30.16704 12.4928 30.16704-12.4928
              12.4928-30.16704l0-512q0-17.67424-12.4928-30.16704t-30.16704-12.4928z`), Ce(t, "class", "icon"), Ce(t, "viewBox", "0 0 1024 1024"), Ce(t, "version", "1.1"), Ce(t, "xmlns", "http://www.w3.org/2000/svg"), Ce(t, "xmlns:xlink", "http://www.w3.org/1999/xlink"), Ce(t, "width", "16"), Ce(t, "height", "16");
  }, m(r, o) {
    $n(r, t, o), Re(t, n);
  }, d(r) {
    r && hn(t);
  } };
}
function hp(e) {
  let t, n, r, o, i, s, a = e[39] + "";
  function l() {
    return e[29](e[39]);
  }
  return { c() {
    t = ut("button"), n = Ur(a), r = Ur("x"), t.disabled = o = e[10] === "skipping", Ce(t, "class", "svelte-19ke1iv"), Po(t, "active", e[39] === e[1] && e[10] !== "skipping");
  }, m(c, u) {
    $n(c, t, u), Re(t, n), Re(t, r), i || (s = Mi(t, "click", l), i = !0);
  }, p(c, u) {
    e = c, 8 & u[0] && a !== (a = e[39] + "") && Wa(n, a), 1024 & u[0] && o !== (o = e[10] === "skipping") && (t.disabled = o), 1034 & u[0] && Po(t, "active", e[39] === e[1] && e[10] !== "skipping");
  }, d(c) {
    c && hn(t), i = !1, s();
  } };
}
function LT(e) {
  let t, n, r = e[2] && up(e);
  return { c() {
    r && r.c(), t = Ur("");
  }, m(o, i) {
    r && r.m(o, i), $n(o, t, i), n = !0;
  }, p(o, i) {
    o[2] ? r ? (r.p(o, i), 4 & i[0] && Tn(r, 1)) : (r = up(o), r.c(), Tn(r, 1), r.m(t.parentNode, t)) : r && (qv(), Fo(r, 1, 1, () => {
      r = null;
    }), Zv());
  }, i(o) {
    n || (Tn(r), n = !0);
  }, o(o) {
    Fo(r), n = !1;
  }, d(o) {
    r && r.d(o), o && hn(t);
  } };
}
function pp(e, t, n) {
  return (100 - (t - n) / (t - e) * 100).toFixed(2);
}
function VT(e, t, n) {
  const r = WN();
  let o, i, s, a, l, c, u, d, f, m, { replayer: h } = t, { showController: p } = t, { autoPlay: g } = t, { skipInactive: v } = t, { speedOption: y } = t, { speed: b = y.length ? y[0] : 1 } = t, { tags: E = {} } = t, { inactiveColor: S } = t, T = 0, C = null, _ = !1, w = null;
  const R = () => {
    C && (cancelAnimationFrame(C), C = null);
  }, O = () => {
    o === "paused" && (l ? (h.play(), l = !1) : h.play(T));
  }, I = () => {
    o === "playing" && (h.pause(), _ = !1);
  }, L = (N, $) => {
    n(6, T = N), _ = !1, l = !1, (typeof $ == "boolean" ? $ : o === "playing") ? h.play(N) : h.pause(N);
  }, D = (N, $, B = !1, U) => {
    w = B ? { start: N, end: $ } : null, n(6, T = N), _ = $, c = U, h.play(N);
  }, P = (N) => {
    let $ = o === "playing";
    n(1, b = N), $ && h.pause(), h.setConfig({ speed: b }), $ && h.play(T);
  };
  var k;
  return Kv(() => {
    n(7, o = h.service.state.value), n(10, i = h.speedService.state.value), h.on("state-change", (N) => {
      const { player: $, speed: B } = N;
      if ($ != null && $.value && o !== $.value)
        switch (n(7, o = $.value), o) {
          case "playing":
            R(), C = requestAnimationFrame(function U() {
              n(6, T = h.getCurrentTime()), _ && T >= _ && (w ? D(w.start, w.end, !0, void 0) : (h.pause(), c && (c(), c = null))), T < u.totalTime && (C = requestAnimationFrame(U));
            });
            break;
          case "paused":
            R();
        }
      B != null && B.value && i !== B.value && n(10, i = B.value);
    }), h.on("finish", () => {
      l = !0, c && (c(), c = null);
    }), g && h.play();
  }), k = () => {
    v !== h.config.skipInactive && h.setConfig({ skipInactive: v });
  }, xl().$$.after_update.push(k), Gv(() => {
    h.pause(), R();
  }), e.$$set = (N) => {
    "replayer" in N && n(17, h = N.replayer), "showController" in N && n(2, p = N.showController), "autoPlay" in N && n(18, g = N.autoPlay), "skipInactive" in N && n(0, v = N.skipInactive), "speedOption" in N && n(3, y = N.speedOption), "speed" in N && n(1, b = N.speed), "tags" in N && n(19, E = N.tags), "inactiveColor" in N && n(20, S = N.inactiveColor);
  }, e.$$.update = () => {
    if (64 & e.$$.dirty[0] && r("ui-update-current-time", { payload: T }), 128 & e.$$.dirty[0] && r("ui-update-player-state", { payload: o }), 131072 & e.$$.dirty[0] && n(8, u = h.getMetaData()), 320 & e.$$.dirty[0]) {
      const N = Math.min(1, T / u.totalTime);
      n(13, d = 100 * N + "%"), r("ui-update-progress", { payload: N });
    }
    655360 & e.$$.dirty[0] && n(9, f = (() => {
      const { context: N } = h.service.state, $ = N.events.length, B = N.events[0].timestamp, U = N.events[$ - 1].timestamp, J = [];
      return N.events.forEach((te) => {
        if (te.type === Ue.Custom) {
          const ie = { name: te.data.tag, background: E[te.data.tag] || "rgb(73, 80, 246)", position: `${pp(B, U, te.timestamp)}%` };
          J.push(ie);
        }
      }), J;
    })()), 1179648 & e.$$.dirty[0] && n(14, m = (() => {
      try {
        const { context: N } = h.service.state, $ = N.events.length, B = N.events[0].timestamp, U = N.events[$ - 1].timestamp, J = function(ie) {
          const z = [];
          let le = ie[0].timestamp;
          for (const j of ie)
            $T(j) && (j.timestamp - le > 1e4 && z.push([le, j.timestamp]), le = j.timestamp);
          return z;
        }(N.events), te = (ie, z, le, j) => ((j - le) / (z - ie) * 100).toFixed(2);
        return J.map((ie) => ({ name: "inactive period", background: S, position: `${pp(B, U, ie[0])}%`, width: `${te(B, U, ie[0], ie[1])}%` }));
      } catch {
        return [];
      }
    })());
  }, [v, b, p, y, () => {
    switch (o) {
      case "playing":
        I();
        break;
      case "paused":
        O();
    }
  }, P, T, o, u, f, i, s, a, d, m, r, (N) => {
    if (i === "skipping")
      return;
    const $ = s.getBoundingClientRect();
    let B = (N.clientX - $.left) / $.width;
    B < 0 ? B = 0 : B > 1 && (B = 1);
    const U = u.totalTime * B;
    L(U);
  }, h, g, E, S, O, I, L, D, () => {
    n(0, v = !v);
  }, () => Promise.resolve().then(() => {
    n(8, u = h.getMetaData());
  }), function(N) {
    Xn[N ? "unshift" : "push"](() => {
      a = N, n(12, a);
    });
  }, function(N) {
    Xn[N ? "unshift" : "push"](() => {
      s = N, n(11, s);
    });
  }, (N) => P(N), function(N) {
    v = N, n(0, v);
  }, () => r("fullscreen")];
}
class zT extends md {
  constructor(t) {
    super(), pd(this, t, VT, LT, dd, { replayer: 17, showController: 2, autoPlay: 18, skipInactive: 0, speedOption: 3, speed: 1, tags: 19, inactiveColor: 20, toggle: 4, play: 21, pause: 22, goto: 23, playRange: 24, setSpeed: 5, toggleSkipInactive: 25, triggerUpdateMeta: 26 }, null, [-1, -1]);
  }
  get toggle() {
    return this.$$.ctx[4];
  }
  get play() {
    return this.$$.ctx[21];
  }
  get pause() {
    return this.$$.ctx[22];
  }
  get goto() {
    return this.$$.ctx[23];
  }
  get playRange() {
    return this.$$.ctx[24];
  }
  get setSpeed() {
    return this.$$.ctx[5];
  }
  get toggleSkipInactive() {
    return this.$$.ctx[25];
  }
  get triggerUpdateMeta() {
    return this.$$.ctx[26];
  }
}
function mp(e) {
  let t, n, r = { replayer: e[7], showController: e[3], autoPlay: e[1], speedOption: e[2], skipInactive: e[0], tags: e[4], inactiveColor: e[5] };
  return t = new zT({ props: r }), e[32](t), t.$on("fullscreen", e[33]), { c() {
    Xv(t.$$.fragment);
  }, m(o, i) {
    fd(t, o, i), n = !0;
  }, p(o, i) {
    const s = {};
    128 & i[0] && (s.replayer = o[7]), 8 & i[0] && (s.showController = o[3]), 2 & i[0] && (s.autoPlay = o[1]), 4 & i[0] && (s.speedOption = o[2]), 1 & i[0] && (s.skipInactive = o[0]), 16 & i[0] && (s.tags = o[4]), 32 & i[0] && (s.inactiveColor = o[5]), t.$set(s);
  }, i(o) {
    n || (Tn(t.$$.fragment, o), n = !0);
  }, o(o) {
    Fo(t.$$.fragment, o), n = !1;
  }, d(o) {
    e[32](null), hd(t, o);
  } };
}
function jT(e) {
  let t, n, r, o, i = e[7] && mp(e);
  return { c() {
    t = ut("div"), n = ut("div"), r = Ht(), i && i.c(), Ce(n, "class", "rr-player__frame"), Ce(n, "style", e[11]), Ce(t, "class", "rr-player"), Ce(t, "style", e[12]);
  }, m(s, a) {
    $n(s, t, a), Re(t, n), e[31](n), Re(t, r), i && i.m(t, null), e[34](t), o = !0;
  }, p(s, a) {
    (!o || 2048 & a[0]) && Ce(n, "style", s[11]), s[7] ? i ? (i.p(s, a), 128 & a[0] && Tn(i, 1)) : (i = mp(s), i.c(), Tn(i, 1), i.m(t, null)) : i && (qv(), Fo(i, 1, 1, () => {
      i = null;
    }), Zv()), (!o || 4096 & a[0]) && Ce(t, "style", s[12]);
  }, i(s) {
    o || (Tn(i), o = !0);
  }, o(s) {
    Fo(i), o = !1;
  }, d(s) {
    s && hn(t), e[31](null), i && i.d(), e[34](null);
  } };
}
function HT(e, t, n) {
  let r, { width: o = 1024 } = t, { height: i = 576 } = t, { maxScale: s = 1 } = t, { events: a = [] } = t, { skipInactive: l = !0 } = t, { autoPlay: c = !0 } = t, { speedOption: u = [1, 2, 4, 8] } = t, { speed: d = 1 } = t, { showController: f = !0 } = t, { tags: m = {} } = t, { inactiveColor: h = "#D4D4D4" } = t, p, g, v, y, b, E, S = o, T = i;
  const C = (w, R) => {
    const O = [o / R.width, i / R.height];
    s && O.push(s), w.style.transform = `scale(${Math.min(...O)})translate(-50%, -50%)`;
  }, _ = () => {
    var w;
    p && (ip() ? document.exitFullscreen ? document.exitFullscreen() : document.mozExitFullscreen ? document.mozExitFullscreen() : document.webkitExitFullscreen ? document.webkitExitFullscreen() : document.msExitFullscreen && document.msExitFullscreen() : (w = p).requestFullscreen ? w.requestFullscreen() : w.mozRequestFullScreen ? w.mozRequestFullScreen() : w.webkitRequestFullscreen ? w.webkitRequestFullscreen() : w.msRequestFullscreen && w.msRequestFullscreen());
  };
  return Kv(() => {
    if (u !== void 0 && sp(u) !== "array")
      throw new Error("speedOption must be array");
    if (u.forEach((R) => {
      if (sp(R) !== "number")
        throw new Error("item of speedOption must be number");
    }), u.indexOf(d) < 0)
      throw new Error(`speed must be one of speedOption,
        current config:
        {
          ...
          speed: ${d},
          speedOption: [${u.toString()}]
          ...
        }
        `);
    var w;
    n(7, r = new MT(a, Object.assign({ speed: d, root: g, unpackFn: ET }, t))), r.on("resize", (R) => {
      C(r.wrapper, R);
    }), w = () => {
      ip() ? setTimeout(() => {
        S = o, T = i, n(13, o = p.offsetWidth), n(14, i = p.offsetHeight - (f ? 80 : 0)), C(r.wrapper, { width: r.iframe.offsetWidth, height: r.iframe.offsetHeight });
      }, 0) : (n(13, o = S), n(14, i = T), C(r.wrapper, { width: r.iframe.offsetWidth, height: r.iframe.offsetHeight }));
    }, document.addEventListener("fullscreenchange", w), document.addEventListener("webkitfullscreenchange", w), document.addEventListener("mozfullscreenchange", w), document.addEventListener("MSFullscreenChange", w), v = () => {
      document.removeEventListener("fullscreenchange", w), document.removeEventListener("webkitfullscreenchange", w), document.removeEventListener("mozfullscreenchange", w), document.removeEventListener("MSFullscreenChange", w);
    };
  }), Gv(() => {
    v && v();
  }), e.$$set = (w) => {
    n(39, t = Fh(Fh({}, t), Lh(w))), "width" in w && n(13, o = w.width), "height" in w && n(14, i = w.height), "maxScale" in w && n(15, s = w.maxScale), "events" in w && n(16, a = w.events), "skipInactive" in w && n(0, l = w.skipInactive), "autoPlay" in w && n(1, c = w.autoPlay), "speedOption" in w && n(2, u = w.speedOption), "speed" in w && n(17, d = w.speed), "showController" in w && n(3, f = w.showController), "tags" in w && n(4, m = w.tags), "inactiveColor" in w && n(5, h = w.inactiveColor);
  }, e.$$.update = () => {
    24576 & e.$$.dirty[0] && n(11, b = op({ width: `${o}px`, height: `${i}px` })), 24584 & e.$$.dirty[0] && n(12, E = op({ width: `${o}px`, height: `${i + (f ? 80 : 0)}px` }));
  }, t = Lh(t), [l, c, u, f, m, h, _, r, p, g, y, b, E, o, i, s, a, d, () => r.getMirror(), () => {
    C(r.wrapper, { width: r.iframe.offsetWidth, height: r.iframe.offsetHeight });
  }, (w, R) => {
    switch (r.on(w, R), w) {
      case "ui-update-current-time":
      case "ui-update-progress":
      case "ui-update-player-state":
        y.$on(w, ({ detail: O }) => R(O));
    }
  }, (w) => {
    r.addEvent(w), y.triggerUpdateMeta();
  }, () => r.getMetaData(), () => r, () => {
    y.toggle();
  }, (w) => {
    y.setSpeed(w);
  }, () => {
    y.toggleSkipInactive();
  }, () => {
    y.play();
  }, () => {
    y.pause();
  }, (w, R) => {
    y.goto(w, R);
  }, (w, R, O = !1, I) => {
    y.playRange(w, R, O, I);
  }, function(w) {
    Xn[w ? "unshift" : "push"](() => {
      g = w, n(9, g);
    });
  }, function(w) {
    Xn[w ? "unshift" : "push"](() => {
      y = w, n(10, y);
    });
  }, () => _(), function(w) {
    Xn[w ? "unshift" : "push"](() => {
      p = w, n(8, p);
    });
  }];
}
class WT extends md {
  constructor(t) {
    super(), pd(this, t, HT, jT, dd, { width: 13, height: 14, maxScale: 15, events: 16, skipInactive: 0, autoPlay: 1, speedOption: 2, speed: 17, showController: 3, tags: 4, inactiveColor: 5, getMirror: 18, triggerResize: 19, toggleFullscreen: 6, addEventListener: 20, addEvent: 21, getMetaData: 22, getReplayer: 23, toggle: 24, setSpeed: 25, toggleSkipInactive: 26, play: 27, pause: 28, goto: 29, playRange: 30 }, null, [-1, -1]);
  }
  get getMirror() {
    return this.$$.ctx[18];
  }
  get triggerResize() {
    return this.$$.ctx[19];
  }
  get toggleFullscreen() {
    return this.$$.ctx[6];
  }
  get addEventListener() {
    return this.$$.ctx[20];
  }
  get addEvent() {
    return this.$$.ctx[21];
  }
  get getMetaData() {
    return this.$$.ctx[22];
  }
  get getReplayer() {
    return this.$$.ctx[23];
  }
  get toggle() {
    return this.$$.ctx[24];
  }
  get setSpeed() {
    return this.$$.ctx[25];
  }
  get toggleSkipInactive() {
    return this.$$.ctx[26];
  }
  get play() {
    return this.$$.ctx[27];
  }
  get pause() {
    return this.$$.ctx[28];
  }
  get goto() {
    return this.$$.ctx[29];
  }
  get playRange() {
    return this.$$.ctx[30];
  }
}
class UT extends WT {
  constructor(t) {
    super({ target: t.target, props: t.data || t.props });
  }
}
const KT = { class: "flex h-full flex-col" }, GT = { class: "monitoring flex-1 bg-gray-100 relative" }, YT = {
  __name: "App",
  setup(e) {
    const t = Ee(!1), n = Ee(), r = new HN();
    let o = null;
    lr(() => {
      r.init();
      let l = [];
      ws({
        checkoutEveryNms: 200,
        emit(c) {
          l.push({
            time: Di().valueOf(),
            content: JSON.stringify(c)
          });
        }
      }), o = o || setInterval(() => {
        r.bulkAdd(l).then((c) => {
          l = [];
        });
      }, 2 * 1e3);
    });
    const i = (l) => {
      const c = Di().subtract(l, "millisecond"), u = n.value.offsetHeight, d = n.value.offsetWidth;
      r.getAll({ time: Di(c).valueOf() }).then((f) => {
        new UT({
          target: n.value,
          props: {
            events: f.map((m) => m.content),
            width: d,
            height: u - 80
          }
        });
      });
    }, s = () => {
      t.value = !0, Li(() => {
        i(10 * 60 * 1e3);
      });
    }, a = () => {
      r.clear();
    };
    return (l, c) => {
      const u = Lg, d = B_;
      return vm(), j0(dt, null, [
        Et(d, {
          class: "rr-block",
          show: Rp(t),
          "onUpdate:show": c[1] || (c[1] = (f) => et(t) ? t.value = f : null),
          "on-after-leave": a,
          "mask-closable": !1
        }, {
          default: ci(() => [
            Et(u, {
              style: { width: "75%", height: "650px" },
              title: "前端监控",
              bordered: !1,
              size: "huge",
              role: "dialog"
            }, {
              "header-extra": ci(() => [
                vr("span", {
                  class: "cursor-pointer",
                  onClick: c[0] || (c[0] = (f) => t.value = !1)
                }, "关闭")
              ]),
              footer: ci(() => []),
              default: ci(() => [
                vr("div", KT, [
                  vr("div", GT, [
                    vr("div", {
                      ref_key: "monitoring_ontainer_ref",
                      ref: n,
                      class: "monitoring-container h-full"
                    }, null, 512)
                  ])
                ])
              ]),
              _: 1
            })
          ]),
          _: 1
        }, 8, ["show"]),
        vr("div", {
          class: "pm-monitoring-sdk-setting",
          onClick: s
        }, "✳️")
      ], 64);
    };
  }
};
R1(YT).mount("#pm-monitoring-sdk-app");
